RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

useradd

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

useradd [man page] - create a new user or update default new user information

2. Synopsis

useradd [options] LOGIN
useradd -D
useradd -D [options]

3. Frequently used options

-c, --comment COMMENT
Any text string. It is generally a short description of the login,and is currently used as the
field for the user’s full name.
-d, --home HOME_DIR
The new user will be created using HOME_DIR as the value for the user’s login directory. The
default is to append the LOGIN name to BASE_DIR and use that as the login directory name.
The directory HOME_DIR does not have to exist but will not be created if it is missing.
-m, --create-home
The user’s home directory will be created if it does not exist. The files contained in
SKEL_DIR will be copied to the home directory if the -k option is used, otherwise the files
contained in /etc/skel will be used instead. Any directories contained in SKEL_DIR or
/etc/skel will be created in the user’s home directory as well. The -k option is only valid
in conjunction with the -m option. The default is to not create the directory and to not copy
any files. This option may not function correctly if the username has a / in it.
-s, --shell SHELL
The name of the user’s login shell. The default is to leave this field blank, which causes
the system to select the default login shell.

4. Examples

Linux command useradd is used to create user account on linux ( unix ) systems. Using command useradd command without any options will only create user account in /etc/passwd file. Let's create user account for user "debian".
useradd debian 
Create user account with useradd linux command - no additional options
To force useradd command to create home directory for a new user as well as create command, copy template files from /etc/skel directory and change default shell, we need to use the following options:
useradd -m -c "Test User" -s /bin/false debian 
Create user account with useradd linux command - with additional options for default shell
Another helpful option for linux useradd command is -D which list system default values:
useradd -D 
List default system values with linux useradd command

Share this linux post:

Submit useradd in Delicious Submit useradd in Digg Submit useradd in FaceBook Submit useradd in Google Bookmarks Submit useradd in Stumbleupon Submit useradd in Technorati Submit useradd in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download