Solved

Red Hat Linux Add User and Group Tutorial

Posted on 2009-07-14
5
2,175 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weird Samba Connectivity Issue... 7 39
AWS CLI - Issue with name display 2 71
CentOS 7 Installation 7 72
Adding more CPU cores to a Linux VM 5 93
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

813 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

17 Experts available now in Live!

Get 1:1 Help Now