當前位置:生活全書館 >

IT科技

> linux如何給使用者分配許可權

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許可權進行其他操作了。

linux如何給使用者分配許可權

標籤: 許可權 linux 分配
  • 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/1p210p.html