主要思路
大同小异,修改 sshd——config 文件,把里面的 PasswordAuthentication 和 PermitRootLogin 都改成 Yes
修改 SSH 配置文件 /etc/ssh/sshd_config
CODE
vi /etc/ssh/sshd_config
|
找到 PermitRootLogin 和 PasswordAuthentication
CODE
# Authentication: LoginGraceTime 120 PermitRootLogin yes //默认为no,需要开启root用户访问改为 yesStrictModes yes # Change to no to disable tunnelled clear text passwords PasswordAuthentication yes //默认为no,改为yes开启密码登陆 |
重启 SSH 服务
Ubuntu/debian 适用
CODE
/etc/init.d/ssh restart
|
Centos 7 适用
CODE
systemctl restart sshd.service
|
方便起见
CODE
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
|
CODE
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
|
CODE
sudo service sshd restart
|
发布者:黄大仙,转载请注明出处:https://jiami.dog/3805.html

文章讨论
评论由 GitHub Discussions 保存。登录 GitHub 后即可留言;已有 WordPress 评论会在下方继续保留。
如果评论组件无法显示,请直接前往 GitHub Discussions。