Command Line User & Root accounts

What is the syntax for adding generic users and Root access users accounts at the command line?
CMILLERAsked:
Who is Participating?
 
majorwooConnect With a Mentor Commented:
man useradd

will tell you what you need to know, the most common are:

-d home_directory
-g initial_group
-G other, groups
-s login_shell
-u UID

so something like

useradd -d /home/majorwoo -g staff -G users -s /bin/bash -u 507 josh

will add a user, account name josh with a home directory of /home/majorwoo whose main group is staff but is also a part of users and whose UID is 507

using the -p to specify the password is not worth it(you have to crypt it first), after making the account use
passwd username

to set the password
0
 
CMILLERAuthor Commented:
Please explain the switches
0
 
majorwooCommented:
to add a root user, add the user above as normal, and configure sudo to give them permissions

for example to create the same user above josh, and give him full root permissions add the following to /etc/sudoers

josh    ALL=(ALL) ALL
0
 
CMILLERAuthor Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.