Solved

Red Hat Linux Add User and Group Tutorial

Posted on 2009-07-14
5
2,167 Views
Last Modified: 2013-12-15
I need to add a new user into a Red Hat Linux box.  How would I do this?  I need to give them root privileges to the box - preferable so they can use sudo.  I am comfortable with the command line, but not Linux.

Thanks,
0
Comment
Question by:awakenings
  • 3
5 Comments
 
LVL 28

Accepted Solution

by:
Jan Springer earned 400 total points
ID: 24850783
groupadd <username>

useradd -d /path/to/homedir/<username> -g <username> -s /bin/bash -m -c 'Free Form Field' <username>

passwd <username>
0
 
LVL 28

Assisted Solution

by:Jan Springer
Jan Springer earned 400 total points
ID: 24850787
Prefacing each command with "sudo" or su to root.
0
 

Author Comment

by:awakenings
ID: 24852050
Jesper,

     Do I need to create the home directory or does it do it automatically?  I'm guessing the useradd should come before the group add?  How do I add them to a particular group though?

Thanks,

Awakenings
0
 
LVL 28

Assisted Solution

by:Jan Springer
Jan Springer earned 400 total points
ID: 24852186
No, groupadd comes first so that you can specify it with the useradd command.

The "-m" says to create the home directory specified by "-d".

Put the correct path to the home directory i.e., /home/awakening

I use groups to identify types of accounts:

1001 email
1002 internal
1003 etc

The "-g" is changed to identify the group that you are putting that individual in.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 100 total points
ID: 24852343
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now