部署堡垒机1——准备环境

1、准备环境centos7

关闭防火墙firewalld

#清空防火墙规则
root@jumpserver-app-t01.novalocal:/root#iptables -F
#关闭开机自启动防火墙
root@jumpserver-app-t01.novalocal:/root#systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
#关闭防火墙
root@jumpserver-app-t01.novalocal:/root#systemctl stop firewalld

设置selinux=disable

#selinux的配置路径:
root@jumpserver-app-t01.novalocal:/root#vim /etc/selinux/config
#查看selinux的状态为Disable
root@jumpserver-app-t01.novalocal:/root#getenforce
Disabled
root@jumpserver-app-t01.novalocal:/root#

 

2、配置国内的yum源,和epel源

cd /etc/yum.repos.d/
# 阿里源——备份mv——重新下载
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

# 清华源——备份cp——修改内容
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo
#清空yum缓存
root@jumpserver-app-t01.novalocal:/root#yum clean all
#生成新的yum缓存
root@jumpserver-app-t01.novalocal:/root#yum makecache

3、安装系统初始化所需的软件

yum install -y bash-completion vim lrzsz wget expect net-tools nc namp tree dos2unix htop iftop iotop unzip telnet slpsmisc nethogs glances bc ntpdate openldap-devel gcc

4、安装JumpServer运行所需的依赖环境

yum -y install git python-pip gcc automake autoconf python-devel vim sshpass lrzsz readline-devel zlib zlib-devel openssl openssl-devel

git ——github全球最大的代码托管平台,获取JumpServer的代码,需要去github下载
python-pip——安装python软件
gcc——解析代码中C语言信息:解释器
automake——实现软件自动编译过程
autoconf——实现软件自动配置过程
python-devel——python开发依赖
readline-devel——操作python命令信息是,实现补全功能

5、修改系统字符集为中文

#修改系统字符集为中文
root@jumpserver-app-t01.novalocal:/root#localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
root@jumpserver-app-t01.novalocal:/root#export LC_ALL=zh_CN.UTF-8
#写入全局配置文件中
root@jumpserver-app-t01.novalocal:/root#echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf
root@jumpserver-app-t01.novalocal:/root#cat /etc/locale.conf
LANG=zh_CN.UTF-8
LC_ALL=zh_CN.UTF-8
root@jumpserver-app-t01.novalocal:/root#

6、检查系统编码

root@jumpserver-app-t01.novalocal:/root#locale
LANG=en_US.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8
root@jumpserver-app-t01.novalocal:/root#

此时使用ls --help就会有中文解释

root@jumpserver-app-t01.novalocal:/root#ls --help
用法:ls [选项]... [文件]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all			不隐藏任何以. 开始的项目
  -A, --almost-all		列出除. 及.. 以外的任何项目
      --author			与-l 同时使用时列出每个文件的作者
  -b, --escape			以八进制溢出序列表示不可打印的字符
      --block-size=SIZE      scale sizes by SIZE before printing them; e.g.,
                               '--block-size=M' prints sizes in units of
                               1,048,576 bytes; see SIZE format below
  -B, --ignore-backups       do not list implied entries ending with ~
  -c                         with -lt: sort by, and show, ctime (time of last
                               modification of file status information);
                               with -l: show ctime and sort by name;
                               otherwise: sort by ctime, newest first

 

posted @ 2023-02-21 19:04  Magiclala  阅读(61)  评论(0编辑  收藏  举报