Sponsored Content
Top Forums Shell Programming and Scripting How to automate adduser on FreeBSD? Post 302505418 by frank_rizzo on Wednesday 16th of March 2011 11:25:31 PM
Old 03-17-2011
please rtfm(in a nice way). work smarter not harder. Smilie

Code:
ADDUSER(8)              FreeBSD System Manager's Manual             ADDUSER(8)

NAME
     adduser -- command for adding new users

SYNOPSIS
     adduser [-CDENShq] [-G groups] [-L login_class] [-M mode] [-d partition]
             [-f file] [-g login_group] [-k dotdir] [-m message_file]
             [-s shell] [-u uid_start] [-w type]

DESCRIPTION
     The adduser utility is a shell script, implemented around the pw(8) com-
     mand, for adding new users.  It creates passwd/group entries, a home
     directory, copies dotfiles and sends the new user a welcome message.  It
     supports two modes of operation.  It may be used interactively at the
     command line to add one user at a time, or it may be directed to get the
     list of new users from a file and operate in batch mode without requiring
     any user interaction.

 

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. Programming

Application crashes in FreeBSD 7.1 while working ok in FreeBSD 6.3

Hello there, My mulithreaded application (which is too large to represent the source code here) is crashing after installing FreeBSD 7.1-RELEASE/amd64. It worked properly on others machines (Dual Cores with 4GB of RAM - FreeBSD 6.2-RELEASE/i386). The current machine has 2x Core 2 Duo... (1 Reply)
Discussion started by: Seenquev
1 Replies

4. 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

5. 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

6. SuSE

automate ispell

Hello!! Is posible to automate ispell?? I have a lot of misspelled text and I want to launch a script that runs ispell choosing for example the first option, all that automatically. Is possible?? Thanks :) (4 Replies)
Discussion started by: elblo
4 Replies

7. 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

8. 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

9. UNIX for Dummies Questions & Answers

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 (6 Replies)
Discussion started by: Zeldforged
6 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 12:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy