Google Cloud Platform(GCP)默认是使用密钥登录,有的人不习惯,还是喜欢用root账户登陆。下面教你开启。
1、在控制台里打开网页版SSH。
2、切换到root账户
1 |
sudu su |
3、修改/etc/ssh/sshd_config文件。
1 |
vi /etc/ssh/sshd_config |
将其中的PermitRootLogin和PasswordAuthentication修改为yes
1 2 |
PermitRootLogin yes PasswordAuthentication yes |
保存退出。
4、重启SSH服务
1 2 3 4 |
#Debian/Ubuntu /etc/init.d/ssh restart #CentOS service restart sshd |
5、修改root密码
1 |
passwd root |
输入两次root密码,接下来就可以使用root密码登录了,打开你的SSH客户端去吧。
本文参考:https://mapgun.com/archives/2235
- 本文固定链接: https://www.ljchen.com/archives/1453
- 转载请注明: ljchen 于 三言两语 发表