Google雲增加root帳戶登錄

前言

之前擼了Google雲之後,因爲不能root登錄的原因,困擾了一段時間。雖然google默認禁用root賬戶登錄是爲了安全着想,不過對於搭建$$R或者建立小博客的我們來說,顯然是開啓root登錄更爲方便。正好今天想起來了,就發出來吧。

第一步

以普通用戶登入後,切換到root賬戶

sudo -i

第二步

修改root密碼

passwd root

第三步

修改SSH配置文件

vi /etc/ssh/sshd_config

i進入編輯
找到PermitRootLogin和PasswordAuthentication

# Authentication:
#LoginGraceTime 2m
PermitRootLogin no //默認爲no,需要修改爲yes
#StrictModes yes
#MaxAuthTries 6

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication no //默認爲no,需要修改爲yes
#PermitEmptyPasswords no

ESC結束編輯,:wq保存修改並退出

第四步

重啓SSH服務使修改生效

/etc/init.d/ssh restart

好了,到了這一步之後我們的VPS就可以使用root登錄了。
如果還是不行,可以試試Winscp普通用戶sftp登錄獲取root權限

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章