gcp开通实例后设置密码连接
2019-12-17 本文已影响0人
Tme_2439
一、在gcp的VM管理界面,点击红框里的SSH
SSH
二、输入sudo -i 切换到root用户
三、修改ssh配置文件
命令:
vi /etc/ssh/sshd_config
修改下面两个参数把no改为yes
PermitRootLogin no
PasswordAuthentication no
重启ssh服务与查看状态:
systemctl restart sshd.service
systemctl status sshd.service
如图
四、给root账户添加密码,
命令:
passwd root
大功告成。