Visitors Now:
Total Visits:
Total Stories:
Profile image
Story Views

Now:
Last Hour:
Last 24 Hours:
Total:

How to create a New User and New User Group in Linux

Wednesday, April 24, 2013 11:59
% of readers think this story is Fact. Add your two cents.

(Before It's News)

Tux-bigIn Linux,with just few commands you can easily create a new user though command line.In this article I will help you to create a new user and will add the user to new user group.

To create a new User Group

You can use the command groupadd to create a new user group

$ groupadd bloggers

Now lets see how create a new user and add him to this group

To create new User

To create a new user we are going to use useradd command,Lets create a new user with username vivek

$ useradd vivek

Now you can attach other information with this user like User description,Use group and User expiry date.

  • -c : To add description about the user
  • -e : To set expiry date to the user in the format of mm/dd/yy
  •  -g : To add user to existing group

For example

$ useradd -c “Blogger and Writer” -g bloggers -e “ 12/24/13 vivek

Now Lets add a new password to the user

$ passwd vivek
Changing password for user vivek.
New UNIX password:

Visit here to read in detail article about changing user password in Linux

If the user is already created then you will get an error if you use useradd command

$useradd -g bloggers vivek
useradd: user vivek exists

We need to use the command usermod in this case

$usermod -g bloggers vivek

Now to verify whether user was successful added,Execute the following command

$ id vivek
uid=501(vivek) gid=510(bloggers) groups=511(bloggers)

Hope you find this article useful,Tell us about topics that you want to be covered by us.You can use the comment form below.



Source:

Report abuse

Comments

Your Comments
Question   Razz  Sad   Evil  Exclaim  Smile  Redface  Biggrin  Surprised  Eek   Confused   Cool  LOL   Mad   Twisted  Rolleyes   Wink  Idea  Arrow  Neutral  Cry   Mr. Green

Top Stories
Recent Stories

Register

Newsletter

Email this story
Email this story

If you really want to ban this commenter, please write down the reason:

If you really want to disable all recommended stories, click on OK button. After that, you will be redirect to your options page.