nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX Tech Support Forum

Create new user account in Ubuntu Linux from command line

This is a discussion on Create new user account in Ubuntu Linux from command line within the Getting started tutorials forums, part of the Linux Getting Started category; Tutorial - How do I create new user account in Ubuntu Linux from command line? Use useradd command create a ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 21st June 2007, 01:49 AM
sweta's Avatar
Contributors
 
Join Date: Feb 2005
Location: New Delhi
OS: Suse, RHEL, Vista
Posts: 213
Thanks: 18
Thanked 11 Times in 11 Posts
Rep Power: 8
sweta has a spectacular aura aboutsweta has a spectacular aura aboutsweta has a spectacular aura about
Default Create new user account in Ubuntu Linux from command line

Tutorial - How do I create new user account in Ubuntu Linux from command line?

Use useradd command create a new user or update default new user information from command line.

Create sweta user account in Ubuntu Linux from command line, enter:
Code:
useradd sweta
Setup a password:
Code:
passwd sweta
Important files
  • /etc/passwd - User account information.
  • /etc/shadow - Secure user account information such as password.
  • /etc/group - Group account information.
  • /etc/default/useradd - Default values for account creation.
  • /etc/skel/ - Directory containing default files.
  • /etc/login.defs - Shadow password suite configuration.
__________________

Last edited by sweta; 21st June 2007 at 01:51 AM.
Reply With Quote
  #2 (permalink)  
Old 7th February 2010, 02:58 AM
Junior Member
 
Join Date: Feb 2010
OS: ubuntu
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
scheiber is on a distinguished road
Default Login not successfull

As far as I experienced you are logged in for less than 10 seconds.

It says Your home directory is listed as: /home/scheiber but is does not appear to exist.

When trying to acces the important files it says 'unsufficient privilege'

How do i make the account fully operational? I only have the single user account and the root password

Regards Arie
Reply With Quote
  #3 (permalink)  
Old 7th February 2010, 11:30 AM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,195
Thanks: 13
Thanked 394 Times in 292 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Some distro configures useradd / adduser commands to create a directory while adding a user account. I suggest you use -m switch to create home directory for new user.
Code:
useradd -m -s /bin/bash userName
passwd userName
To solve your current problem, login as root and create directory manually:
Code:
cd /home
ls -l
mkdir scheiber
chmod  0700 scheiber
chown -R scheiber:scheiber scheiber
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
The Following 2 Users Say Thank You to nixcraft For This Useful Post:
madhudeva (7th March 2010), scheiber (9th February 2010)
  #4 (permalink)  
Old 7th February 2010, 12:15 PM
vamsi's Avatar
Senior Member
 
Join Date: Nov 2009
Location: Bangalore / India
OS: Ubuntu, CentOS
Scripting language: php
Posts: 186
Thanks: 113
Thanked 9 Times in 7 Posts
Rep Power: 2
vamsi will become famous soon enoughvamsi will become famous soon enough
Default

you can also define the home directory my appending -d following with the path of the directory..
for more detailed explanation on useradd command..
type man useradd in terminal
__________________
Linux
windows
Reply With Quote
The Following User Says Thank You to vamsi For This Useful Post:
scheiber (9th February 2010)
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to create multiple user account? droidwork Shell scripting 11 23rd February 2008 01:35 PM
Ubuntu Linux add a user to group sweta Ubuntu / Debian 0 1st November 2007 02:41 AM
Command line remote access angelus_kit Networking, Firewalls and Security 7 5th September 2007 06:30 PM
HP UX create or add users from command line using useradd rockdalinux HP-UX 0 20th December 2006 02:13 PM
HP UX creating user account with SAM - it is easy to use rockdalinux HP-UX 0 20th December 2006 02:01 PM


All times are GMT +5.5. The time now is 09:03 PM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40