To Add User in Linux,
useradd -g johngroup-s /bin/bash -m -d /home/john -u 199999 john
The above command will create user John which has a specific uid 199999, under group johngroup along with a home folder in /home/john and will also add an entry in ssh /bin/bash for the respective user.
Command Arguments
- -g To create user in specific group
- -s To create user entry in ssh
- -u user with specific uid
- -m and -d to create with home directory