mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-27 23:56:07 +03:00
Updated 谷歌云开启root账户与密码登录 (markdown)
parent
1086f955ce
commit
5ea125278f
@ -1,3 +1,27 @@
|
||||
谷歌云默认关闭root账户远程登录,也不允许使用密码登录,只能用证书,出于方便的目的,可能需要开启root账户使用密码登录。以下为操作过程:
|
||||
在谷歌云操作界面,使用网页ssh登录相应VPS主机,如下图所示;
|
||||
![](https://github.com/proxysu/Resources/raw/master/image/googlevpsroot1.png)
|
||||
在谷歌云操作界面,使用网页ssh登录相应VPS主机,如下图所示,点击图中红线圈出的倒三角图标:
|
||||
![](https://github.com/proxysu/Resources/raw/master/image/googlevpsroot1.png)
|
||||
如下图所示,选择红线标示的项,中文界面,选择对应位置。
|
||||
![](https://github.com/proxysu/Resources/raw/master/image/googlevpsroot2.png)
|
||||
在打开的网页版ssh登录界面,依次输入以下命令:
|
||||
sudo sed -i 's/PermitRootLogin /#PermitRootLogin /g' /etc/ssh/sshd_config
|
||||
|
||||
sudo sed -i 's/PasswordAuthentication /#PasswordAuthentication /g' /etc/ssh/sshd_config
|
||||
|
||||
sudo sed -i 's/PermitEmptyPasswords /#PermitEmptyPasswords /g' /etc/ssh/sshd_config
|
||||
|
||||
sudo echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
||||
|
||||
sudo echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
||||
|
||||
sudo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config
|
||||
|
||||
sudo systemctl restart sshd
|
||||
|
||||
生成随机密码:
|
||||
|
||||
cat /dev/urandom | tr -dc '_A-Z#\-+=a-z(0-9%^>)]{<|' | head -c 20 ; echo ''
|
||||
|
||||
sudo passwd root
|
||||
|
||||
输入两次上面生成的随机密码,这个随机密码要保存好。这个就是登录root账户的密码。
|
Loading…
Reference in New Issue
Block a user