新建yanfa組,組內用戶權限和root一致

新建一個組:yanfa  ,組內用戶和root權限一致vim

注:這樣作的好處便於查詢是哪一個用戶登陸服務器,執行啥操做。通常都是直接使用root帳戶登陸,不便於查詢究竟是誰執行服務器

一、修改sudoerside

vim /etc/sudoers,添加組yanfait

root    ALL=(ALL)       ALL
%admin  ALL=(ALL)       ALL  #若是是用戶,則不須要%class

二、在root權限下添加組和組用戶test

groupadd yanfa登錄

添加用戶:test01 、test0二、test03權限

useradd test01密碼

useradd test02im

useradd test03

將用戶添加到組yanfa

usermod -a -G admin test01
usermod -a -G admin test02

usermod -a -G admin test03

3、分別以test01 、0二、03登陸,並切換到管理員權限

sudo su -

輸入密碼:

而後發現是管理員root權限。執行who,發現帳戶是test01

相關文章
相關標籤/搜索