CentOS安装配置


CentOS安装配置

Esxi安装Centos

1.配置如下

1

2

3

4

5

6

7

8

9

安装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

文章作者: 文彦
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 文彦 !
评论
  目录