为dmit的vps增加ssh密码直接登陆

dmit主机默认只能使用ssh key来登陆,有一些朋友习惯使用ssh password密码方式来登陆。

这里提供一个方法,希望帮助到群友

修改 /etc/ssh/sshd_config 配置文件

sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;

主要是设置 :

PermitRootLogin 为 yes

PasswordAuthentication 为 yes

然后重启sshd即可

service sshd restart 即可

进行设置之前,需要设置/修改root的密码,这样后续才可以需要登陆。

 

亚马逊云azamon也可以使用这种方式password登陆ssh

 

 

主机差评君首发于zhuji188.com,转发请标明来源https://zhuji188.com/943.html
THE END
分享
二维码
< <上一篇
下一篇>>