mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:32:45 +00:00 
			
		
		
		
	
		
			
				
	
	
	
	
		
			1.7 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.7 KiB
		
	
	
	
	
	
	
	
Name
useradd - add a new user to the system password file
Synopsis
# useradd [options] <login>
Description
This program adds a new user to the system.
By default, the user will be added to the users group (which has a GID of 100).
This program must be run as root.
Options
- -u,- --uiduid: The user identifier for the new user. If not specified, an unused UID above- 1000will be auto-generated.
- -g,- --gidgid: The group identifier for the new user. If not specified, it will default to 100 (the users group).
- -p,- --passwordpassword: The encrypted password for the new user. If not specified, it will default to blank.
- -s,- --shellpath-to-shell: The shell binary for this login. The default is- /bin/Shell.
- -m,- --create-home: Create the specified home directory for this new user.
- -d,- --home-dirpath: Set the home directory for this user to path. By default, this is- /home/username, where- usernameis the value of login.
- -n,- --gecosgeneral-info: GECOS information about this login. See Wikipedia for more information.
Exit Values
- 0 - Success
- 1 - Couldn't update the password file
- 3 - Invalid argument to option
- 4 - UID already in use
- 12 - Couldn't create home directory
Files
- /etc/passwd- new user information (such as UID and GID) is appended to this file.
- /home/- user home directory is created here if the- -mflag is specified.
Examples
# useradd -u 300 -m kling
# useradd -m -u 400 --gid 200 --gecos "Sergey Bugaev" bugaevc
# useradd quaker
# useradd --gid 1000 -d /tmp/somedir -n "Dan MacDonald" danboid
# useradd --create-home supercomputer7
