在linux下給用戶分配權限的步驟大致有兩步,具體介紹如下:
1、添加用戶
首先要用adduser命令添加一個普通用戶,命令如下:
#adduser tommy //添加一個名為tommy的用戶
#passwd tommy //修改密碼
Changing password for user tommy.
New UNIX password: //在這輸入新密碼
Retype new UNIX password: //再次輸入新密碼
passwd: all authentication tokens updated successfully.
2、賦予root權限
修改 /etc/sudoers 文件,找到下面一行,將前面的注釋符號(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
接著修改用戶,讓其能夠屬于root組(wheel),具體命令是:
#usermod -g root tommy
修改完畢之后就能夠使用tommy帳號登錄,接著用命令su -,就可以獲得root權限進行其他操作了。
以上就是小編的分享了,希望能夠幫助到大家。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com