Linux serverNETWORK ADMINISTRATIONS

Add Common User On Centos 8 | Part 2

1. To add a common user account on CentOS Server, Set like follows.
useradd centos8 (type this command in ur console)
passwd centos8

2. If you’d like to switch to root user account from a common user, use [su] command to do so.
centos
su – (type this command on ur console)

3. If you’d like to limit users to run [su] command, set like follows.
usermod -G wheel centos
nano /etc/pam.d/su
unmark this section
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
# verify settings with a user that is not in allowed group
su –
Password:
su: Permission denied

4. If you’d like to remove a user accounts, Set like follows.
userdel centos
[root@localhost ~]# userdel -r centos

see u for my next video…

source

centos 8

Leave a Reply

Your email address will not be published. Required fields are marked *