AWS / GCP 开启密码登录¶
操作步骤 切换为root账户 设置root账户密码 然后执行命令 在下方的“c”前加上:上一条命令输出的行数 然后执行命令 在下方的“c”前加上:上一条命令输出的行数 重启SSH 或
操作步骤¶
切换为root账户
sudo -i
设置root账户密码
passwd root
然后执行命令
cat -n /etc/ssh/sshd_config | grep 'PermitRootLogin'
在下方的“c”前加上:上一条命令输出的行数
sed -i "c PermitRootLogin yes" /etc/ssh/sshd_config
然后执行命令
cat -n /etc/ssh/sshd_config | grep 'PasswordAuthentication no'
在下方的“c”前加上:上一条命令输出的行数
sed -i "c PasswordAuthentication yes" /etc/ssh/sshd_config
重启SSH¶
systemctl restart sshd.service
或
/etc/init.d/ssh restart