Syntax
#useradd
--> if you want to make a user with desire uid, gid etc
(or) #useradd –u
-G
-C
#groupadd
(or)
# groupadd –g
#passwd
(or)
#passwd –d
Explanation
/etc/group :
If
Backup : x : 502 : secondary users specification
If u create a user with useradd, it will generate 7 fields auto.
Ex: for useradd
#user add –u 1000 –g backup –G print, flag
-d/raj -c “supersuer “ raj
The above line create what our desire user with name of raj
If u create a userid with 500 means, next one is 502
Then it will check to create next one means, It will choose the largest group id & make to add +1
Commands
#id sai --> give gid & uid
#finger sai --> It will show all details about user sai
#user del sai --> remove all details frm /etc/group, shadow & passwd… But
/home/sai & /var files are existing
#user del -r sai --> delete sai from entire file system
#passwd sai--> set password (/etc/shadow)
#passwd –d sai --> remove password ’’
#pwconv --> It updates detail from /etc/passwd to /etc/shadow, /etc/shadow is read-only
#passwd –l sai --> To lock a passwd for sai
#passwd –u sai --> To unlock a passwd for sai
#usermode –s /bin/nologin sai --> to change the shell lever from default one /bin/bash to /bin/nologin. Then sai will not login into system. He blocked
To lock (ie) nologin to all user except root to make file
To create
# touch /etc/nologin
To remove
# rm –rf /etc/nologin
[Note: If you want to protect particular user, go to /etc/passwd file and enter “exclamation mark” at end of that particular user.]
Benefit for Boot loader passwd
If u want to change root’s passwd, you cant enter into linux with single user mode and change it
Steps:
Switch on the system
press ’e’ (i.e.) it shows on the screen
Enter into kernel………. Like ths
But you set bootloader (Grub) passwd, you will not enter inot root’s section directly.
Do it first
#grub –mds-crypt --> This makes encryptions files.
Boot passwd also available (or) grub
OS passwd also available
How to set OS passwd?
It’s set only after the Installed,
Go to #/boot/grub/grub.conf
Enter the OS passwd below the title menu
If you want to set encrypted passwd to grub or OS, you can use
#grub-mds-crypt file & copy the result set to grub
Password=msd-result of crypt
{ Below the splash ing }
Password—mds result of crypt for grub passwd
No comments:
Post a Comment