简介
- 本篇是关于
Google Cloud的一些使用指南,主要是为了解决远程连接的问题。
- 以下不会涉及
Linux操作系统的应用,内容仅供学术研究使用。
SSH远程连接
- 使用工具为
Xshell、Xftp,主要目的是为了更改Google Cloud远程主机的root密码,使得SSH工具可连接。
1. 切换到root角色
sudo -i
2. 修改SSH配置文件
- 修改
/etc/ssh/sshd_config配置文件,将以下两项默认值改为yes:
PermitRootLogin yes
PasswordAuthentication yes
# 默认此项为no,改为yes,运行root角色登录
PermitRootLogin yes
# 默认此项为no,改为yes,开启密码认证
PasswordAuthentication yes
3. 设定root密码
# 修改root密码
passwd root
# 成功后输出以下讯息:
passwd: all authentication tokens updated successfully.
4. 重启SSH服务
Google Cloud中找不到重启SSH的命令,那么选择重启VPS主机:
# 重启主机
reboot
总结
Google Cloud和虚拟机不一样的地方在于远程连接上,以上设定之后,就可以使用Xshell连接上VPS了。