Tuesday, June 30, 2015

Initial Setting CentOS 7 - Add an User

Add an User "cent" as an example below.

[root@dlp ~]# 
useradd cent 

[root@dlp ~]# 
passwd cent 

Changing password for user cent.
New UNIX password:

# set password

Retype new UNIX password:

# confirm

passwd: all authentication tokens updated successfully.
[root@dlp ~]# 

exit 


Try to switch to a user that was added above.

dlp login: 
cent

# input user name

password: 

# password

[cent@dlp ~]$ 

su - 

# switch to root

Password:

# root password

[root@dlp ~]# 


Make a user be only a user who can switch to root as an administration user. (it's 'cent' in this example)

[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            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so

To forward to emails for root user to another user, set like follows. (it's 'cent' in this example)

[root@dlp ~]# 
vi /etc/aliases
# Person who should get root's mail
# last line: uncomment and change to a user
root: 
cent
[root@dlp ~]# 

Related Posts:

  • DNS Server - 1 Install BINDInstall BIND to configure DNS server which resolves domain name or IP address. BIND uses 53/TCP,UDP Install BIND. [root@dlp ~]# yum -y inst… Read More
  • DNS Server - 3 Start BindStart BIND. [root@dlp ~]# systemctl start named  [root@dlp ~]# systemctl enable named Change DNS settings that the server … Read More
  • DNS Server - 2 Set ZoneCreate zone files that servers resolve IP address from domain name For internal zone This example uses internal address[10.0.0.0/24], domain name[ser… Read More
  • A Basic MySQL Tutorial About MySQL MySQL is an open source database management software that helps users store, organize, and retrieve data. It is a very powerful program … Read More
  • How To Setup Your Own VPN With PPTP Intro One of the commonly asked questions from our users is how to add another IP address to their server. You can assign your own private IP addres… Read More

0 comments:

Post a Comment