龙岩同城网

回复:0 发表于 2021-6-24 13:32
发表于 2021-6-24 13:32:47 | 显示全部楼层 |阅读模式

googel cloud 修改ssh 连接密码 [复制链接]

googel cloud 修改ssh 连接密码

说明:Google Compute Engine创建的VM实例(以下简称GCE)默认ssh key登陆并禁用了root。个人云服务器开启会降低登陆安全性

开启步骤
1.在GCE VM实例列表中,选择“在浏览器窗口中打开”访问实例

2.切换到root账户
sudo su

3.修改SSH配置文件/etc/ssh/sshd_config
vi/etc/ssh/sshd_config

4.找到PermitRootLogin和PasswordAuthentication大概在中下的位置,按i进入编辑模式

# Authentication:
LoginGraceTime 120
PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
StrictModes yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes //默认为no,改为yes开启密码登陆
按esc退出编辑模式,输入:wq回车保存

5.重启SSH服务

service sshd restart #centos/etc/init.d/ssh restart #debian or Ubuntu6.设置root账户密码
passwd root
输入两次密码确认7.重复第5步操作重启ssh服务生效        


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发表新贴 返回顶部