鍍金池/ 問答/Java  網(wǎng)絡(luò)安全/ 如何使用 root 身分 ssh bluehost 的 vps?

如何使用 root 身分 ssh bluehost 的 vps?

請問一下
我現(xiàn)在只能用一個(gè)不是 root的權(quán)限登入到我的VPS...
但我想用root身分

xxx@xxx.com [~/.ssh]# su
-jailshell: /bin/su: Permission denied
ssh root@xxx.xxx.xxx.xxx
root@xxx.xxx.xxx.xxx: Permission denied (publickey).

請問我要怎麼用 root 身分登入到我的VPS?
要怎麼設(shè)置才對

回答
編輯回答
敢試

修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:

## Allow root to run any commands anywhere
root    ALL=(ALL)     ALL
yourUserName   ALL=(ALL)     ALL

修改完畢,現(xiàn)在可以用yourUserName帳號(hào)登錄,然后用命令 sudo – ,即可獲得root權(quán)限進(jìn)行操作。

2017年7月10日 12:36