Sponsored Content
Full Discussion: Adduser or useradd
Top Forums UNIX for Dummies Questions & Answers Adduser or useradd Post 302845563 by Aia on Wednesday 21st of August 2013 09:55:17 PM
Old 08-21-2013
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.
This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

question related to command "adduser"

Hello.. I dont know if i can ask this question in this session..if wrong please correct me.. This is my question.. When iam creating a user with command " adduser xxx" Where are the changes happening.. I know in /etc/passwd , /etc/shadow... in /home Is there any i missed.. please... (1 Reply)
Discussion started by: esham
1 Replies

2. Programming

adduser

Hi, Let me know any urls where i can get the source code for "adduser" program.. Please help.. esham (1 Reply)
Discussion started by: esham
1 Replies

3. Shell Programming and Scripting

useradd

Gurus, I need to add a user to all the machines. I need a script to do this. I did one but it does not allow me to su to root within a ssh session i open. It exists saying su: Sorry. Please let me know how i can do it. I do not have the freedom of using sudo either. Regards (4 Replies)
Discussion started by: earlysame55
4 Replies

4. UNIX for Advanced & Expert Users

useradd?

Hi Experts, when using useradd command, what are the necessary options/arguments to be included? Please advice. (4 Replies)
Discussion started by: etcpasswd
4 Replies

5. Shell Programming and Scripting

shell script for nessus-adduser

I took a stab at writing a script to automate the interactive process of adding users to Nessus - I have zero previous coding experience. So far, it doesn't get me anywhere. I took small sections of code from posts I found on this site and others:... (1 Reply)
Discussion started by: nolamiami
1 Replies

6. Shell Programming and Scripting

exec a build command (adduser) in a script

Hi, With a awk script i create a "adduser line" $ cat /tmp/tmp.ldif | awk -f ldif2adduser.awk adduser --uid 1002 --gid 1000 --gecos "ROUSSIN Guy" --home /homeL/guy --shell /bin/bash --disabled-password guy If i cut and paste this line, all is fine. But in a shell script i get errors : ... (2 Replies)
Discussion started by: guyr
2 Replies

7. Shell Programming and Scripting

How to automate adduser on FreeBSD?

After just posting a query on beginners@perl.org inquiring about the perl API for automating useradd/userdel/usermod on FreeBSD, I got to thinking: Maybe perl is not the best approach to automating useradd/usermod/userdel. We have a list of users from a windows system and we want to run a... (5 Replies)
Discussion started by: siegfried
5 Replies

8. Red Hat

Adduser -> Access denied

hi, I have a problem with any user i created on a linux server RH. With the user root i did: adduser toto passwd toto (to give it a password - message : "all authentication tokens updated successfully") I can do a "su - toto", but when I try to connect it directly by ssh i have the message... (3 Replies)
Discussion started by: Castelior
3 Replies

9. Solaris

Solaris 10 adduser

Brain teaser, I was given the task below. I believe the consultant runs software on his laptop that probes our QA tier web servers for xxx The two web servers are xxx I attempt useradd command on XXX which seems to work, but when I attempt to assign a pwd, the OS denies it and says user... (1 Reply)
Discussion started by: yellow_mustard
1 Replies

10. UNIX for Advanced & Expert Users

Adduser

hi, when i want to "adduser newuser" i receved this warning : event type "audit_buf" is a fixed event and may not be manipulated help me please (2 Replies)
Discussion started by: rezasadeghi
2 Replies
adduser(8)						      System Manager's Manual							adduser(8)

NAME
adduser - Adds a new user interactively SYNOPSIS
/usr/sbin/adduser DESCRIPTION
Security Note If you have enhanced security installed on your system, you should use the dxaccounts command to add users. See the Security manual and the dxaccounts(8) reference page for more information. The adduser command is an interactive command for adding new user accounts to your system. The command prompts you for specific informa- tion and informs you of its activity and error conditions. The adduser command invokes /usr/sbin/useradd to add the user account information to /etc/passwd and the hashed password database (if present). Only the superuser can execute this command. The command performs the following tasks: Prompts you to enter a login name for the new user. Enter the login name. If this entry already exists in the passwd file, the command informs you of this and exits. If the entry does not already exist, the command creates one for the new user. Prompts you to enter a UID for the new user. A default UID, which is based on previously existing UID's in the /etc/passwd file, is displayed and can be selected by pressing the Return key. Enter a new UID or accept the default. The command uses this UID in the /etc/passwd file entry for the new user. Note While it is possible to have multiple entries with identical login names and/or identical user id's, it is usually a mistake to do so. Routines that manipulate these files will often return only one of the multiple entries, and that one by random selection. Prompts you for the full name of the new user. Enter the user's full name. This is sometimes called the gecos entry and is dis- played by the finger command. Prompts you to enter a login group for the new user and specifies the default group, users. To accept the default, press the Return key. To select a different group, enter the name of that group, 8 characters or less. If the group does not exist, the command displays a message saying that the group is unknown, lists the names of the groups that are avail- able, and asks whether or not you want to add the new group to the /etc/group file. If you choose the default, the command calls the addgroup command to add the new group to the /etc/group file. The addgroup command queries for the group number of this new group and displays a default value based on existing group numbers in the /etc/group file. Select the default value by pressing Return. Enter a group number or select the default. At this point, the addgroup command ends and the adduser command resumes. There is a limitation on the number of users that can be added to a group. The maximum line length is LINE_MAX as defined in the <limits.h> file. It is recommended that the users be divided into a number of manageable groups. See the System Administration manual for more information on the /etc/group file. Prompts you for the name of other groups for the user to belong to. Again, the group you specify must already exist. If you specify a group to which the user already belongs, the command informs you of this. Prompts you to enter the base directory for the new user and specifies the default directory, /usr/users. To accept the default, press the Return key. To select a different home directory, enter the path of that directory. The path that you specify must exist within a mounted file system. Displays a message that it is adding the new user. At this point, the command makes an entry for the user in the passwd file, creates the home directory, creates the /var/spool/mail directory if necessary, sets ownership and access permissions on the new user's home and mail directories, and copies startup files such as for the new user to the home directory. Asks if you want to edit the authentication file entry for the user. If the environment variable EDITOR is set, adduser will use $EDITOR to edit the user's authentication entries. The adduser command automatically runs the passwd command, which asks you to enter and verify a new password for the user. Note that you cannot use all lowercase letters. If you do, the command asks that you use unusual capitalization and suggests using control characters. If you mistype the password when you are asked to verify it, no password is set and the account is disabled. To enable the user account, enter the passwd command followed by the user name. At this point, the command ends. NOTES
Users are advised to migrate to the /usr/sbin/useradd utility or the dxaccounts utility as this command may be removed in a future version of the operating system. RESTRICTIONS
The addgroup command limits a group name to eight characters or less. If you specify a new group name when prompted, your entry must meet this restriction. EXAMPLES
Enter a login name for the new user (for example, john): chris Enter a UID for (chris) [5006]: Enter a full name for (chris): Chris Ryan Enter a login group for (chris) [users]: Enter another group that (chris) should be a member of. (<Return> for none): Enter a parent directory for (chris) [/usr/users]: The shells are: /bin/sh /bin/csh /bin/ksh Enter a login shell for (chris) [/bin/sh]: Adding new user ... Do you wish to edit the auth file entry for this user (y/[n])? You must enter a new password for (chris). Changing password for chris. New password: Retype new password: FILES
Specifies the command path Group file Password file Default files directory SEE ALSO
Commands: addgroup(8), chfn(1), chsh(1), dxaccounts(8), groupadd(8), mkpasswd(8), passwd(1), removeuser(8), useradd(8), userdel(8), vipw(8) Files: group(4), passwd(4) adduser(8)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy