Ubuntu獲得根使用者許可權時su認證失敗的解決方法

2021-05-24 02:16:56 字數 1228 閱讀 6499

ubuntu 安裝後,root使用者預設是被鎖定了的,不允許登入,也不允許「su」到 root。有人說這是個不好的實踐,特別是對於伺服器來說。我覺得對於桌面使用者來說,這樣安全性更高一些,是應該的;但對於伺服器可以設定成「允許 su 到root,但不允許root使用者直接登入」。而我為了開發時的方便,則在桌面和伺服器上都採用這種方式。 

◆允許 su 到 root

非常簡單,下面是設定的方法:

me@tipfoo:~$ sudo passwd

password: <--- 輸入安裝時那個使用者的密碼

enter new unix password: <--- 新的root使用者密碼

retype new unix password: <--- 重複新的root使用者密碼

passwd:已成功更新密碼

◆允許root登入

如果要 允許root登入(不推薦),則這樣操作:

me@tipfoo:~$ gksu /usr/sbin/gdmsetup

(或 者使用桌面選單:系統>系統管理>登入視窗)

點「安全」選項頁,選擇「允許本地管理員登入」。

注:這一步依賴上一 步

◆不輸入密碼直接登入

在論壇上也看見有人抱怨,家中的ubuntu不能像window$那樣──不用輸入密碼就能 登入。其實同樣能做到:

就在上一步的「安全」選項頁中,勾選:

「啟用自動登入」,「使用者」選擇(如:「me」);

注 意:公共用的計算機千萬不能這麼設定!

◆ssh登入遠端伺服器

如果遠端伺服器只允許root使用者ssh到伺服器時, 在ubuntu下,必須「su 到root」使用者才能登入成功(具體是看伺服器端的配置)。

首先,複製金鑰到「/root/.ssh /」目錄,

me@tipfoo:~$ su

password:

root@tipfoo:/home/me# chmod 600 -r /root/.ssh/

root@tipfoo:/home/me# ssh -p 27482 11.22.33.44

enter passphrase for key '/root/.ssh/id_rsa':

last login: thu jun 21 14:29:00 2007 from 11.22.33.45

Ubuntu 中獲得root使用者許可權

按住ctrl alt t開啟終端,在終端中輸入 sudo passwd root 那麼在螢幕中會以此顯示一下資訊 enter new unix password 在這輸入你的密碼 retype new unix password 確定你輸入的密碼 passwd password updated su...

mysql使用者許可權時間 Mysql使用者許可權管理

1.檢視mysql使用者 select user,host,authentication string from mysql.user user host authentication string root localhost root b7d0cf7b6e2f root 127.0.0.1 ro...

ubuntu 下新增使用者 並獲得root許可權

是普通管員,是系統管理員,在 ubuntu 下,root使用者預設是沒有密碼的,因此也就無法使用 據說是為了安全 想用root的話,得給root使用者設定乙個密碼 sudo passwd root 然後登入時使用者名稱輸入root,再輸入密碼就行了。ubuntu建使用者最好用adduser,雖然ad...