New user in Linux

useradd option writes
Options:
-b, --base-dir BASE_DIR base directory of new account's home directory
-c, --comment COMMENT new account's GECOS field
-d, --home-dir HOME_DIR new account's home directory
-D, -- defaults show or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiry date for new account
-f, --inactive INACTIVE password inactive period for
new account -g, --gid GROUP name or ID of new account's primary group
- G, --groups GROUPS list of additional groups for new accounts
-h, --help show this help message and launch
-k, --skel SKEL_DIR use this directory as skeleton directory
-K, --key KEY=VALUE do not use /etc Default in /login.defs
-l, --no-log-init Don't add this user to recent logins and failed logins database
-m, --create-home Create user's home directory
-M, --no- create-home do not create the user's home directory
-N, --no-user-group do not create a group with the same name
-o, --non-unique allow creating users with duplicate UIDs
-p, --password PASSWORD encrypted new account password
-r, --system create a system account
-s, --shell SHELL login shell for new account
-u, --uid UID user ID of new account
-U, --user-group create group with the same name as user
-Z , --selinux-user SEUSER use the specified SEUSER for SELinux user mapping

 

Ubuntu add user wrote
sudo useradd baiyu -m -s /bin/bash
sudo passwd baiyu

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326972242&siteId=291194637