centos 允许 root远程登陆
安装 openssh-server
yum install -y openssl openssh-server
修改配置文件
vim /etc/ssh/sshd_config
修改内容为下面的:
#放开22端口
Port 22 #AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
//允许任意ip访问呢
ListenAddress ::
#LoginGraceTime 2m
//允许root用户登陆
PermitRootLogin yes #StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# 允许使用密码认真
PasswordAuthentication yes
启动ssh服务
systemctl start sshd.service
重启网络
service network restart
设置开机启动ssh服务
systemctl enable sshd.service