首页 > 系统相关 >linux系统一键开启root登陆

linux系统一键开启root登陆

时间:2023-01-06 16:34:12浏览次数:55  
标签:sshd sudo 一键 PasswordAuthentication PermitRootLogin 登陆 linux root

服务器只能key登陆,用这个后直接可以root方式登陆

sudo -i
echo root:要设置的密码 |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;
sudo service sshd restart

 

标签:sshd,sudo,一键,PasswordAuthentication,PermitRootLogin,登陆,linux,root
From: https://www.cnblogs.com/devilx/p/17030859.html

相关文章