Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Class 8

User and group part 1

/etc/passwd = user information

/etc/group = group information

/etc/shadow = user password info

/etc/gshadow = group password info

/home

/var/spool/mail

/etc/shadow

Aa bb cc

Aa , bb =same password

Cc = no password

Vim /etc/shadow

aa:$6$Asdor1LY0cQGuX2e$Ev3yBkmhkQqQoc5HH3KYMT/
BUcRm4uCUhedPs8XWJwjC.wOIl0dpiQjSU5zlh4.6NSU3LHz.BptUgNHty3r0E.:19709:0:99999:7:::

aa =user name

:$6$Asdor1LY0cQGuX2e$Ev3yBkmhkQqQoc5HH3KYMT/
BUcRm4uCUhedPs8XWJwjC.wOIl0dpiQjSU5zlh4.6NSU3LHz.BptUgNHty3r0E.: =encrypted password

19709 = 1/1/1970 = no of days

:0: = minimum password age ,5

99999 = max password age , 30

:7::: = warning =

See in easy way

Chage -l aa

Change the password setting

Chage aa

Min password age = 5

Max password age = 30

Warning = 5

Account expire = 31/12/2024


Lock the user account

Usemod -L bb

Unlock the account

Usermod -u bb

/etc/gshadow = group password info

Groupadd sales

Gpasswd sales

/home = home directory

.bash_logout = use to exit from account

.bash_profile = login to account

.bashrc = it is use to make command alias

Mkdir = m

Vim .bashrc

Alias mk=mkdir

Alias abc= touch

:wq

Bash

/etc/skel = it redirect the data to user home directory

/var/spool/mail = user mail save

Structure of user

Vim /etc/default/useradd

GROUP=100 = user can make max 100 group member

HOME=/home = home

INACTIVE=-1

EXPIRE=

SHELL=/bin/bash

SKEL=/etc/skel

CREATE_MAIL_SPOOL=yes

Vim /etc/login.defs

User password change after first login


Passwd --expire cc

Or

Chage -d 0 cc

To see who is and wad login successfully

Last

To see who was login unsuccessfully

Lastb

Who =

Id

Uid = 0 = root

Cloud = 0

/etc/passwd = /etc/passwd-

/etc/group = /etc/group-

/etc/shadow = /etc/shadow-

/etc/gshadow = /etc/gshadow-

Make a user but not use useradd command

Make a user , not use useradd , not entry in /etc/passwd file

Vim xyz

test1:x:2000:2000::/home/test1:/bin/bash

test2:x:2001:2001::/home/test2:/bin/bash

:wq

Newusers xyz

Su , sg , sudo

You might also like