HERE I AM INTRODUCING SOME USER COMMAND AND THEIR USE IN OUR
DAILY USER ADMINISTRATION
useradd - for adding users to your linux machine
syntax : useradd -[option] [$username]
the main options are as listed below with a example.
useradd -u 508 -d /var/user1 -s /bin/bash newuser
create a user named newuser with uid 508 ,home directory /var/user1 and default shell as /bin/bash
useradd -M newuser4
create a user named newuser4 without creating a home directory for the user
useradd -N newuser5
create a user named newuser5 without creating a private group for the user
useradd -r newuser6
create a system user ie uid below 500
useradd -e 2013-12-05 newuser1
create a user named newuser1 with expire date 05-12-2013
useradd -g ftp newuser2
create a user named newuser2 with default group as ftp here instead of group name we can also use
the gid of the perticular group
useradd -G ftp,root newuser3
create a user named newuser3 with primary group newuser3 and secondry groups root,ftp
usermod -Command used for modifying the user parameters.
syntax : usermod -[option] [$user]
the above mentioned options (ie useradd options) can also used with usermod
userdel : Command for deleting user
syntax : userdel -[option] [$user]
userdel without option will delete the user but it will not delete the home directory for the user for that we have to use -r option
userdel -r newuser3
this command remove newuser3 as well as its home directory
groupadd - Command used for adding a group
syntax : groupadd -[options] [$groupname]
here is some examples
groupadd -g 567 newgroup
create a group named newgroup with gid 567
groupmod -Command for modifying group parameter
groupdel - Command for removing a group
continued ...............
HERE I AM INTRODUCING SOME USER COMMAND AND THEIR USE IN OUR
DAILY USER ADMINISTRATION
DAILY USER ADMINISTRATION
useradd - for adding users to your linux machine
syntax : useradd -[option] [$username]
the main options are as listed below with a example.
useradd -u 508 -d /var/user1 -s /bin/bash newuser
create a user named newuser with uid 508 ,home directory /var/user1 and default shell as /bin/bash
useradd -M newuser4
create a user named newuser4 without creating a home directory for the user
useradd -N newuser5
create a user named newuser5 without creating a private group for the user
useradd -r newuser6
create a system user ie uid below 500
useradd -e 2013-12-05 newuser1
create a user named newuser1 with expire date 05-12-2013
useradd -g ftp newuser2
create a user named newuser2 with default group as ftp here instead of group name we can also use
the gid of the perticular group
useradd -G ftp,root newuser3
create a user named newuser3 with primary group newuser3 and secondry groups root,ftp
usermod -Command used for modifying the user parameters.
syntax : usermod -[option] [$user]
the above mentioned options (ie useradd options) can also used with usermod
userdel : Command for deleting user
syntax : userdel -[option] [$user]
userdel without option will delete the user but it will not delete the home directory for the user for that we have to use -r option
userdel -r newuser3
this command remove newuser3 as well as its home directory
groupadd - Command used for adding a group
syntax : groupadd -[options] [$groupname]
here is some examples
groupadd -g 567 newgroup
create a group named newgroup with gid 567
groupmod -Command for modifying group parameter
groupdel - Command for removing a group
continued ...............