Thursday, January 14, 2016

groupmod,usermod ,passwords(Red Hat 7)

groupmod uses:::
 groupmod -n newmane oldname

to modify existing groupids
groupmod -g 2000 ateam( suppose previously roup a ateam has agroup id of 1005 now it will be 2000)


usermod even helps change a group of auser::
usermod -g  newgroup username
(now it will assign the username to newgroup
 

adding a supplemental group to a user


usermod -aG newgroup username
(this will append a newgroup that is supplemental one for the username)


differences between groupmod and groupadd ??
 groupmod just changes the name and group id of a existing group whereas usermod can change the group of a existing group, append a supplemental group to any existing user..the examples can be seen above..




managing user passwords::
 passwords stored in /etc/shadow file

three parts in amodern password
     $1$gCj La2/Z$6 Pu0EK0AzfCj xj v2ho LOB/

1.. 1: The hashing algorithm .The number 1 indicates an MD5 hash. the number 6 appears when $HA-512 hash is used
2. gCjLa2/Z: The salt used to encrypt the hash.
3:6Pu0 EK0AzfCj x j v2ho LOB/: the encrypted hash

authconfig - - passalgo ::: a command that determines which is the appropriate setting for password protection in /etc/shadow file


Password aging::;
 The several options are as follows::
chage -d 0 username ::: will force a user to update on next login..
chage -l username :: will list a username current settings

chage -E yyyy-mmmm-DD will expire an account on specific day
  #nologin sheel (confusion)

No comments:

Post a Comment