Centos root权限的变化
生活随笔
收集整理的這篇文章主要介紹了
Centos root权限的变化
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
方法一:更改 /etc/sudoers 文件,
找到以下一行,把前面的凝視(#)去掉
## Allows people in group wheel to run all commands%wheel ? ?ALL=(ALL) ? ?ALL
然后改動用戶,使其屬于root組(wheel),
命令例如以下:
#usermod -g root devuser改動完成,如今能夠用tommy帳號登錄,然后用命令 su – 。就可以獲得root權限進行操作。
方法二:改動 /etc/sudoers 文件。
找到以下一行。在root以下加入一行,
例如以下所看到的:
## Allow root to run any commands anywhereroot ? ?ALL=(ALL) ? ? ALL
devuser ? ALL=(ALL) ? ? ALL
改動完成,如今能夠用devuser帳號登錄,然后用命令 sudo – ,就可以獲得root權限進行操作。
方法三:改動 /etc/passwd 文件。
找到例如以下行。把用戶ID改動為 0 ,
例如以下所看到的:
devuser:x:0:33:devuser:/data/webroot:/bin/bash 與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的Centos root权限的变化的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 干式双离合和湿式双离合的优缺点
- 下一篇: Angular 学习笔记——servic