给用户添加sudo 权限脚本:
userNameList=(dp dam das bidw) ;
for userName in ${userNameList[*]};
do
echo $userName ' ALL=(ALL) NOPASSWD: ALL,!/bin/su' > /etc/sudoers.d/$userName ;
more /etc/sudoers.d/$userName ;
done
给用户添加sudo 权限脚本:
userNameList=(dp dam das bidw) ;
for userName in ${userNameList[*]};
do
echo $userName ' ALL=(ALL) NOPASSWD: ALL,!/bin/su' > /etc/sudoers.d/$userName ;
more /etc/sudoers.d/$userName ;
done
转载于:https://www.cnblogs.com/sunt9/p/6686171.html