Create new user from run
To create a new user from the run
command, you can use the following syntax:
run useradd <username>
Replace <username>
with the desired username for the new user.
For example:
run useradd john
This will create a new user named john
with a default home directory and shell.
If you want to specify additional options, you can use the following flags:
-m
: Create the user's home directory and set the default shell.-s
: Specify the default shell for the new user.-d
: Specify the home directory for the new user.-c
: Specify a comment for the new user.
For example:
run useradd -m -s /bin/bash -d /home/john john
This will create a new user named john
with a home directory /home/john
, a default shell /bin/bash
, and a comment.
Note: The run
command is used to execute a command as the root user, so you need to have root privileges to create a new user.