[root@rhel1 ~] # useradd xcg [root@rhel1 ~] # passwd xcg Changing password foruser xcg. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@rhel1 etc] # ll sudoers - r - - r - - - - - . 1 root root 4002 Mar 2 2012 sudoers [root@rhel1 etc] # chmod 755 sudoers [root@rhel1 etc] # ll sudoers - rwxr - xr - x. 1 root root 4002 Mar 2 2012 sudoers [root@rhel1 ~] # vim /etc/sudoers root ALL = ( ALL ) ALL xcg ALL = ( ALL ) ALL # 这个在切换时,是需要输入密码的,密码是当前普通用户的密码 kongzhong ALL = ( ALL ) NOPASSWD: ALL # 这个在切换时,不需要输入密码 [root@rhel1 ~] # vim /etc/sudoers % wheel ALL = ( ALL ) ALL 然后,修改普通用户,使其属于wheel 组,命令如下: [root@rhel1 etc] # usermod -g wheel kongzhong1 [root@rhel1 ~] # vim /etc/passwd kongzhong2:x: 504 : 504 :kongzhong2: / home / kongzhong2: / bin / bash 修改后如下 kongzhong2:x: 0 : 500 :kongzhong2: / home / kongzhong2: / bin / bash (责任编辑:IT) |