🌞用root用户登入
🌛GoogleCloud控制台面板,浏览器远程连接
🌛切换到root角色
sudo -i
🌛修改ssh配置文件
vi /etc/ssh/sshd_config
- 修改文件的部分内容
1
2
3
4
5# Authentication:
PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes //默认为no,改为yes开启密码登陆
🌛给root用户设置密码
passwd root
🌛重启SSH服务使修改生效
- 如果系统是centos6,使用命令
/etc/init.d/ssh restart
- 如果系统是centos7,使用命令
systemctl restart sshd
🌛修改防火墙规则
- 左侧抽屉中找到防火墙配置,根据自己实际需要配置好入站和出站规则之后,保存就可以。
- 进入实例,点击最上面的编辑,在网络标记中添加刚刚配置的规则名,滚动到页面最下面,点击保存即可。
- 然后去找个在线的站点端口检测,测一下端口是否处于开放状态。
🌛登录
- 在xshell中,直接使用root账号密码登录。