oracle等vps开启root登录

162次阅读
没有评论

共计 308 个字符,预计需要花费 1 分钟才能阅读完成。

原理是修改
/etc/ssh/sshd_config
使用密钥登录系统以后
执行如下命令

sudo -i

切换为root用户
接着输入

echo root:password|sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;

其中password为root的密码
重启sshd服务

sudo service sshd restart

正文完
 
评论(没有评论)