CentOS 装openssh-server

yum -y update
yum install -y openssl openssh-server

核实一下是否有 sshd进程

ps -ef | grep sshd

修改配置文件 vi /etc/ssh/sshd_config ,把 #Port 22 前面的 #去掉,打开22端口,(当然你可以自定义)

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

然后一起贴入下面三行命令:

sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
reboot

发表评论