设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7

@[TOC](通过root账户 和 password(密码)来登录Google Cloud Platform(GCP)谷歌云-- Centos 7)

谷歌提供了网页版的terminal来ssh到服务器。

先进入computer engine 目录下的VM instances
设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第1张图片
设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第2张图片
点击
connect
下的ssh,选择Open in browser windows
然后服务器的页面就会以浏览器窗口化弹出来。

服务器页面更改设置

首先要提升自己的权限为root。

sudo su

或者

sudo -i

然后更改root用户密码:

passwd

在这里插入图片描述
这里需要注意的是,这个密码最好使用在线密码生成器,同时包含大小写字母、数字、符号,同时八位以上。我这就是不好的例子(随意简单设置的)
附上两个在线密码生成器:
https://passwordsgenerator.net/
https://suijimimashengcheng.51240.com/

换完密码后用vim编辑器打开sshd-config文件。
在这里插入图片描述
然后按i使用输入模式,

  • PermitRootLogin设置为yes
    设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第3张图片
  • PasswordAuthentication设置为yes
    设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第4张图片
    然后按esc退出编辑模式,然后:wq保存。

下一步重启服务器(Centos7)。

首先可以查看一下服务器状态:

systemctl status sshd.service

然后重启服务器:

systemctl restart sshd.service

or :

reboot

如果你服务器装的linux系统,则使用:

/etc/init.d/ssh restart

输入之后会弹出对话框:
设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第5张图片
点击reconnect,重新连接服务器。

设置通过root账户和password(密码)使用Xshell来登录Google Cloud Platform(GCP)谷歌云 -- Centos 7_第6张图片
稍等片刻服务器便重新上线。

对于windows玩家:

让我们打开xshell或者putty
使用刚才设置好的账号密码登录谷歌云服务器。

ssh root@00.000.00.0000

然后按照xshell/putty的提示进行操作,一路同意下去。

你可能感兴趣的:(Google,Cloud)