Adduser or useradd | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Adduser or useradd

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-21-2013
Zeldforged Zeldforged is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 23 August 2013, 9:11 AM EDT
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
Adduser or useradd

I am just wondering why there are two similar commands for creating a user. Could you please point me when I should choose adduser and when useradd? This puzzles me a little.

Thanks,
Panos
Sponsored Links
    #2  
Old 08-21-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 20 October 2014, 2:03 AM EDT
Location: Zürich
Posts: 8,484
Thanks: 332
Thanked 1,047 Times in 914 Posts
They're the same command, or should be:


Code:
[root@ns1 ~]# ll $(which useradd)
-rwxr-x---. 1 root root 103096 Dec  7  2011 /usr/sbin/useradd
[root@ns1 ~]# ll $(which adduser)
lrwxrwxrwx. 1 root root 7 Jan 26  2013 /usr/sbin/adduser -> useradd

The Following User Says Thank You to Scott For This Useful Post:
Zeldforged (08-22-2013)
Sponsored Links
    #3  
Old 08-21-2013
Aia's Avatar
Aia Aia is offline
Registered User
 
Join Date: May 2008
Last Activity: 20 October 2014, 12:20 AM EDT
Posts: 430
Thanks: 28
Thanked 139 Times in 130 Posts
The command to create an account in Linux, at the command line is useradd.
This is the command you are expected to know if you go to pass CompTIA Linux+, LPIC 101 or RHCSA certification.

In some systems it can have more or less "automatic" parameters entered for you using some defaults: like it may or may not create a home for the user, automatically, if you do not provide those parameters.
useradd -D shows the defaults. Some files that it uses for configuration support are /etc/default/useradd and /etc/skel/

On the other hand, adduser is more of a prompted, interactive command, where you are asked for settings if you don't enter it initially. It is a different binary in distros like Ubuntu. However, in distros like Redhat, it is just a link to useradd, so those feature do not exist.
The Following User Says Thank You to Aia For This Useful Post:
Zeldforged (08-22-2013)
    #4  
Old 08-22-2013
Zeldforged Zeldforged is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 23 August 2013, 9:11 AM EDT
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
Thanks very much

PS: What Linux distro do you suggest me to use in order to prepare for my LPI exams ?
Sponsored Links
    #5  
Old 08-22-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 20 October 2014, 2:03 AM EDT
Location: Zürich
Posts: 8,484
Thanks: 332
Thanked 1,047 Times in 914 Posts
LPI claims to be "vendor neutral", so it shouldn't matter.
The Following User Says Thank You to Scott For This Useful Post:
Zeldforged (08-23-2013)
Sponsored Links
    #6  
Old 08-22-2013
Aia's Avatar
Aia Aia is offline
Registered User
 
Join Date: May 2008
Last Activity: 20 October 2014, 12:20 AM EDT
Posts: 430
Thanks: 28
Thanked 139 Times in 130 Posts
Quote:
Originally Posted by Zeldforged View Post
PS: What Linux distro do you suggest me to use in order to prepare for my LPI exams ?
If you do not have LPI 101 already, I recommend CompTIA Linux+ since, at this time, it has a partnership with LPI, which if you pass CompTIA LX0-101 and LX0-102 you will be passing the certification as well for LPI 101 and 102 and you can ask them for both certifications.

In any case, these certifications are vendor neutral, which means you do have to know quite a bit about many things Linux.
For instance, instead of having to know, only, rpm and and yum as in Redhat; with LPI you'll need to know dpkg, and apt-get, as well.

Therefore, you'll need a distribution based in Debian and a distribution based in Redhat, for better results.

RHCSA and RHCE are the next step. Theses exams are real hands on, and there is no multiple choice questions. For these you must configure whatever they ask you in a virtual machine, and the killer is that you must know things very well, including Selinux, because the time allow will be your enemy.
The Following User Says Thank You to Aia For This Useful Post:
Zeldforged (08-23-2013)
Sponsored Links
    #7  
Old 08-23-2013
Zeldforged Zeldforged is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 23 August 2013, 9:11 AM EDT
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
Thanks again guys, you've been extra helpful
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Solaris 10 adduser yellow_mustard Solaris 1 06-30-2012 07:45 AM
Adduser -> Access denied Castelior Red Hat 3 07-28-2011 04:35 AM
How to automate adduser on FreeBSD? siegfried Shell Programming and Scripting 5 03-17-2011 02:39 PM
shell script for nessus-adduser nolamiami Shell Programming and Scripting 1 07-24-2009 01:44 PM
adduser esham Programming 1 11-18-2005 07:21 AM



All times are GMT -4. The time now is 07:23 AM.