Solved

Red Hat Linux Add User and Group Tutorial

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

708 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