Oralce/Aws/Gcp 启用root 登录
修改 sshd-config 文件,把里面的 PasswordAuthentication 和 PermitRootLogin 都改成 Yes
修改 SSH 配置文件 /etc/ssh/sshd_config
vi /etc/ssh/sshd_config找到 PermitRootLogin 和 PasswordAuthentication
# 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 适用
/etc/init.d/ssh restartCentos 7 适用
systemctl restart sshd.servicesudo 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 当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »