原文:http://www.server-world.info/en/note?os=CentOS_6&p=initial_conf&f=1
1、创建一个用户
[root@dlp ~]# useradd cent
2、修改用户密码
[root@dlp ~]#passwd cent
Changing password for user cent.
New UNIX password: #设置用户新密码
Retype new UNIX password: #确认
passwd: all authentication tokens updated successfully.
[root@dlp ~]#exit #退出root登录状态
3、使用新创建用户cent登录
dlp login:cent
password: #输入密码
[cent@dlp ~]$su - #切换到root用户
Password: #root用户密码
[root@dlp ~]# #到这里说明已切换到root
4、创建一个用户(示例中是cent用户),使这个用户是唯一一个可以切换到管理员用户root的用户
[root@dlp ~]#usermod -G wheel cent
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
auth required pam_wheel.so use_uid
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
5、Configure the email forwading settings. For example, if you'd like to forward emails for root account to another user, set like follows.
按如下设置配置email地址。比如:如果你想将root的email发送给其它用户,按如下设置:
root: cent