This tutorial explain how to create a system administrator user after installing a CentOS 6.3 server.
A CentOS server installed, if you didn't installed it yet have a look to the CentOS 6.x Server Installation tutorial.
Create a System Administrator user
Login as root user and create an administrator user:
centos-srv login: root Password: ... # useradd administrator # passwd administrator Changing password for user administrator. New password: Retype new password: passwd: all authentication tokens updated successfully. #
Logout and login as administrator user, then try to switch to root using su command:
centos-srv login: administrator password: $ su - Password: #
Make administrator user as the only a user who can switch to root by adding it to the wheel group and editing PAM service configuration:
# usermod -G wheel administrator # Add administrator to wheel group # vi /etc/pam.d/su ... # Uncomment the following line to require a user to be in the "wheel" group. auth required pam_wheel.so use_uid ...
Add administrator to the sudoers file:
# visudo ... # Add the following last lines # System Administrator can use all root privilege administrator ALL=(ALL) ALL
Forward emails for root to administrator user by editing the /etc/aliases file, then run newaliases command:
# vi /etc/aliases ... # Person who should get root's mail root: administrator ... # newaliases #