Solved

Red Hat Linux Add User and Group Tutorial

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

Suggested Solutions

Title # Comments Views Activity
How to make a Bash alias that takes parameters 5 72
Run same command on multiple files in Linux 3 56
how to configure linux OS using Ubuntu 7 58
Samba Question 11 74
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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…
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.:

840 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