Topics

visudo

Adding new users and admins to Linux server

Check Installing CentOS 6.2 on VMware post.

Using admin user avoids common mistakes done when logging as root, instead use sudo to run root commands.

mkdir /server

#adding web-server user www
adduser www -d /server -s /sbin/nologin

#adding admins group to use instead of root
groupadd admins
visudo
#add
%admins ALL=(ALL)       NOPASSWD: ALL

#add new admin 
adduser admin -g admins
#set password
passwd admin

#add email for user admin
vi /etc/aliases
#add
admin: admin@example.com
#rebuild data
newaliases