GCP,oralce,aws开启root登录
距离文章编辑已经过去了 1292 天,实际情况可能有所变动。
主要思路
大同小异,修改 sshd——config
文件,把里面的 PasswordAuthentication
和 PermitRootLogin
都改成 Yes
修改SSH配置文件/etc/ssh/sshd_config
Code
vi /etc/ssh/sshd_config |
找到PermitRootLogin和 PasswordAuthentication
Code
# Authentication: |
重启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 |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
Powered By Valine
v1.5.2
v1.5.2