Centos更换yum源,安装ssh server

时间:2022-03-08 00:28:36

先连上网,然后更换yum源

1. 新建的用户没有sudo权限,所以首先切换到root用户
su -
输入密码

2. 备份之前的yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3. 下载yum源centos6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

4. 清理并生成缓存
yum clean all
yum makecache

安装ssh server

$ yum search ssh
$ yum install openssh-server
$ chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off