門戶首頁 > 幫助中心 > 云服务器帮助 > 一键启用debian系统root并设置密码

一键启用debian系统root并设置密码

逐个执行或者复制一键执行些命令 

cp /etc/ssh/sshd_config > /etc/ssh/sshd_config.bak

sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config

sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config

sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config

sed -i "s|#ClientAliveInterval 0|ClientAliveInterval 60|" /etc/ssh/sshd_config

sed -i "s|#ClientAliveCountMax 3|ClientAliveCountMax 3|" /etc/ssh/sshd_config

service ssh restart && service sshd restart && systemctl restart ssh && systemctl restart sshd && /etc/init.d/ssh restart && /etc/init.d/sshd restart

echo root:${1:-uIBeBgQ3itF4ryL231} | chpasswd

密码为 uIBeBgQ3itF4ryL231

  • 0 用戶發現這個很有用
此文章對您是否有幫助?