Google Cloud Platform使用root账号密码登录SSH及修改root密码
<p>首先进入Google Cloud Platform实例面板</p><p>进入SSH是以普通用户的身份登录,我们需要切换到ROOT用户,输入命令:</p>
<pre>sudo -i</pre>
<p>然后输入命令修改SSH配置文件/etc/ssh/sshd_config (进入后按键盘“i”修改结束后按键盘“ESC”然后输入“:wq!”保存退出,如果不想保存就按一下键盘上的“ESC”,输入“:q!”如果你不确定是否成功.可以通过“cat filename”命令来查看)</p>
<pre>vi /etc/ssh/sshd_config</pre>
<p>找到<span style="color: #ff0000;">PermitRootLogin</span>和<span style="color: #ff0000;">PasswordAuthentication</span>这两项把后面的no改为<span style="color: #0000ff;">yes</span></p>
<p></p>
<p>修改完成后保存退出,修改后需要给我们的root用户设置密码。</p>
<pre>passwd root</pre>
<p>设置新密码后重启SSH服务才能生效</p>
<pre>systemctl restart sshd.service</pre>
<p>完成以上即可使用SSH软件root用户直接登录。</p>
<p class="post-copyright">未经允许不得转载:<ahref="https://www.wangchao.info/">王超博客</a> » <ahref="https://www.wangchao.info/1793.html">Google Cloud Platform使用root账号密码登录SSH及修改root密码</a></p>
页:
[1]