Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-10-2005, 05:47 PM   #16
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374

Originally posted by zameer_india
useradd -d /home/zameer99 -g zameer99 -s /bin/bash zameer99
after bash u used zameer99............... why?
The documentation for the useradd program gives this as its usage:
       useradd [-c comment] [-d home_dir]
               [-e expire_date] [-f inactive_time]
               [-g initial_group] [-G group[,...]]
               [[-M] -m [-k skeleton_dir]] [-o] [-p passwd]
               [-s shell] [-u uid] login
The thing to note is the "login" argument. Everything you see in brackets ( [ ] ) is optional. However, if you use any optional arguments, they must come before "login". You cannot swap them around. You replace login with the user name of the account you're trying to create. Since it doesn't have brackets, you have to give a value for it. You can read the documentation for yourself with: man useradd

I chose zameer99 because your previous posts were adding a number to the end of zameer, and I wanted to use one that you had not tried yet.
Old 01-10-2005, 11:32 PM   #17
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
Thanx Helmet...U gave me a gr8 and well descriptive reply.....

with regds,
zameer ahmed syed
Old 01-11-2005, 01:48 AM   #18
Registered: Dec 2004
Location: Québec
Distribution: Gentoo, Kubuntu Karmic
Posts: 48

Rep: Reputation: 15
When you add a user with the command add user, the following happens :
- One line is added in /etc/passwd (where a:b:c:d:e:f:g ):
a) username is the name of your user
b) x indicates that you're using /etc/shadow for your passwords
c) 510 is the numerical ID of the user username
d) 520 is the numerical ID of username's group
e) comment is a comment to describe user username (it will appear in the finger command for exemple)
f) /home/dir is the home directory of username
g) /bin/shell is the shell username will be using by default

- One line is added in /etc/group if you didn't use -g under RH (where a:b:c:d ):
a) groupname is the name of the group
b) x indicates that you're using /etc/shadow for your passwords
c) 520 is the numerical ID of the group groupname
d) username2 will only appear if you did something like (adduser -g 520 username2)

- One line is added in /etc/shadow (where a:b:c:d:e:f:g:h:i ):
a) username is the name of the user (matching /etc/passwd)
b) * is the passord encrypted (* means that the account is not active)
c) 12791 is the last time the password has been changed (days since 1 jan,1970)
d) 0 is the number of day before password can be changed (0 indicates anytime)
e) 99999 is the number of day before password expires
f) 7 is the number of days of warning before the password expires
g) number of days after password expires that account is disabled
h) number of days since 1 jan,1970 that an account has been disabled
i) the last field is for a futur use

- The home directory of the user is created and the files in /etc/skel are copied in it. The directory should look like this :
# ls -lad /home/username
drwx------ 2 username usersgroup 1024 jan 10 06:40 /home/username

If not, do the following with the root account :
# chown -R username:usersgroup /home/username
(it will assign the directory and all file in it to username)
# chmod 700 /home/username
(it will give the rights read, write and execute tu username)

Then assigne a password to username :
# passwd username

Last edited by denver1980; 01-11-2005 at 01:51 AM.
Old 01-11-2005, 02:39 AM   #19
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
hi Denver....

Thanx for Ur complete (100 % ) descritption.... this enhanced my knowledge as well as to be useful for next newbies ..... good work...



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
linux login: incorrect login poweroff Linux - General 4 03-02-2004 04:03 PM
DEVFS login incorrect john8675309 Linux - General 0 12-21-2003 02:36 AM
vsftp Login incorrect tandre Linux - Software 2 04-28-2003 09:39 AM
Login incorrect Hawama Jabeen Linux - Networking 7 09-17-2001 08:48 AM
Login incorrect?? BrianG Linux - Networking 2 04-10-2001 09:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration