q useradd [Entry files]
v
/etc/passwd
v
/etc/shadow
v
/etc/group
v
/etc/gshadow
v
/etc/shells
v
/etc/default/useradd
v
/etc/skel
[Automatically created file for user’s home like.bashProfile,.bashrc,.bashHistory]
v
/var/spool/mail/<username>
v
/etc/login.defs
r User's Types:
v
root
user: Administrator (#)
v
system
user: service (mail/ftp/ssh/daemons)-cannot login
v
regular
user: student, guest, shohan ($)
q useradd shohan
v
Login
Name: shohan
v
UID:
q useradd [options] LOGIN-username
v
useradd
<username>
v
useradd -d
<Home_directory> <username>
v
useradd
-c <Comments> <username>
v
useradd
-s <Shell> <username>
v
useradd
-u <UID-user ID> <username>
v
useradd
-g <Primary-GID> <username>
v
useradd
-g <Primary-GroupName> <username>
v
useradd
-G <Secondary-GID> <username>
v
useradd
-G <Secondary-GroupName> <username>
v
useradd
-N <Create user without group> <username>
o useradd –u 1010 –g family –G cisco –s /bin/bash –c “Shohanur Rahaman” –d
“/home/shohan” shohan
o id shohan [To check weather this user available in the system]
q
userdel [options] LOGIN-username
v userdel
<username> [Delete user without deleting Home Directory + Mail Spool]
v userdel -rf shohan
·
-f --force [force actions removal of user still
logged in]
· -r --remove [remove home directory and mail spool]
v userdel -rf shohan
· -r --remove [remove home directory and mail spool]
Tags
RHCSA