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