解決方法如下:
1>、進入超級用戶模式。也就是輸入"su -",系統會讓你輸入超級用戶密碼,輸入密碼後就進入了超級用戶模式。
2>、添加文件的寫權限。也就是輸入命令"chmod u+w /etc/sudoers"。
3>、編輯/etc/sudoers文件。也就是輸入命令"vim /etc/sudoers",輸入"i"進入編輯模式,
找到這一行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(這裏的xxx是你的用戶名),然後保存(就是先摁一下Esc鍵,然後輸入":wq")退出。
4>、撤銷文件的寫權限。也就是輸入命令"chmod u-w /etc/sudoers"。
至此,問題解決。
1>、進入超級用戶模式。也就是輸入"su -",系統會讓你輸入超級用戶密碼,輸入密碼後就進入了超級用戶模式。
2>、添加文件的寫權限。也就是輸入命令"chmod u+w /etc/sudoers"。
3>、編輯/etc/sudoers文件。也就是輸入命令"vim /etc/sudoers",輸入"i"進入編輯模式,
找到這一行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(這裏的xxx是你的用戶名),然後保存(就是先摁一下Esc鍵,然後輸入":wq")退出。
4>、撤銷文件的寫權限。也就是輸入命令"chmod u-w /etc/sudoers"。
至此,問題解決。
[oracle@dev ]$su root口令:[root@dev ]#chmod u+w /etc/sudoers[root@dev ]#vim /etc/sudoers[root@dev ]#chmod u-w /etc/sudoers[root@dev ]#su oracle