2014年3月19日星期三

Linux Commands for Beginners lesson 6 -- usseradd,passwd commands

 in this part, I will show you how to add user to your system and how to change user's password


1.COMMAND:
       useradd 
  DESCRIPTION:
       create a new user or update default new user information
 SYNOPSIS:
       useradd [options] LOGIN


 OPTIONS:
      -g, --gid GROUP
           The group name or number of the user's initial login group.
     -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
           A list of supplementary groups which the user is also a member of.
    -m, --create-home
           Create the user's home directory if it does not exist.
   
     -s, --shell SHELL
           The name of the user's login shell.


Example:
piniheaven@fish:~$ ls /home
piniheaven
piniheaven@fish:~$ sudo  useradd jack -m -g users -s /bin/bash   #create home folder for jack, add jack to users group and specify bash shell to jack
[sudo] password for piniheaven: 
piniheaven@fish:~$ ls /home
jack  piniheaven



2.COMMAND:
    passwd
  DESCRIPTION:
    change user password


 SYNOPSIS:
       passwd  [LOGIN]


Example:
piniheaven@fish:~$ sudo passwd jack
Enter new UNIX password:
Retype new UNIX password: 

passwd: password updated successfully

没有评论:

发表评论