ubuntu 20.04配置ssh远程服务
1、开启服务
/etc/init.d/ssh start
查看ssh服务状态 sudo service ssh status
正常是active(running)
2、修改ssh登陆配置
sudo vim /etc/ssh/sshd_config
修改以下配置:
33 #LoginGraceTime 2m
34 #PermitRootLogin prohibit-password
35 #StrictModes yes
36 #MaxAuthTries 6
37 #MaxSessions 10
#To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
修改为:
#LoginGraceTime 2m
PermitRootLogin yes
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no
4、重启ssh服务即可
sudo service ssh restart