CentOS安装配置
Esxi安装Centos
1.配置如下
安装SSH
查看是否安装了
openssh
# yum list installed | grep openssh-sver
如果没安装
#yum install openssh-server
如果安装,修改配置文件
/etc/ssh/sshd_config
,打开配置Port 22 ListenAddress 0.0.0.0 ListenAddress :: PermitRootLogin yes PasswordAuthentication yes
防火墙放出
在防火墙上做端口映射,然后使用
xshell
连接
配置yum
源
配置阿里云
yum
源查看
yum
源文件夹# ll /etc/yum.repos.d
备份文件
# mkdir /etc/yum.repos.d/backup # mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
下载配置文件
# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
或者新建一个
CentOS-Base.repo
写入如下文件# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - mirrors.aliyun.com #failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com #failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com #failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-$releasever - PowerTools - mirrors.aliyun.com #failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-$releasever - AppStream - mirrors.aliyun.com #failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
更新配置文件
# yum clean all # yum makecache
以上配置成功
安装zsh
# 安装 # yun install zsh # 验证 # cat /etc/shells # 切换为zsh # chsh -s /bin/zsh
如果提示没有
chsh
,需要安装# 查看包 # dhf -q provides '*/chsh' # 结果可知在 util-linux-user 中 # 安装 # dnf install util-linux-user # 切换 # chsh -s /bin/zsh # 重新登录一个终端应用设置,查看当前shell # echo $SHELL
安装git
yum install git
安装oh-my-zsh
# 下载 git clone https://gitee.com/mirrors/oh-my-zsh.git # 移动并改名 mv oh-my-zsh/ ~/.oh-my-zsh #复制出模板到用户目录 cp .oh-my-zsh/templates/zshrc.zsh-template .zshrc
主题
启动
zsh
# zsh
更换主题
vim .zshrc
ZSH_THEME="steeef" source .zshrc