initial configure -- create user

原文: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

[root@dlp ~]#vi /etc/pam.d/su
#%PAM-1.0  

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.

# uncomment the following line取消下面这些行的注释

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@dlp ~]#vi  /etc/aliases
# Person who should get root's mail
# end of the file: uncomment and change to a user

root: cent
[root@dlp ~]#newaliases     # reload

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值