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
没有评论:
发表评论