Adding new users

Posted by Steve on Tue 28 Sep 2004 at 13:52

Adding new users is something that you will need to do if you want to allow other users to use your machine.

To add a new user is simple enough. First of all you need to become root, you can do this by logging in with your normal user account then running the su command.

Once you are root you can add a new user with the adduser command, this needs a single parameter - the name of the account to add.

If you want to give the user 'John Smith' a login account you could run 'useradd jsmith' to create a login for him.

Once this is done there are two more things you need to do - set the password for this account (they can change it themselves later) - you can do this by running 'passwd jsmith'

When you run passwd it will ask you for the password to set twice, to make sure you've typed what you think you've typed.

The next thing you need to do is make a home directory for them. This will normally just involve running:

mkdir /home/jsmith
chown jsmith:users /home/jsmith

This creates a directory with the same name as the login account beneath the /home directory - then changes it to be owned by the user.

If you omit the 'chown' command the user will not have permission to save files inside their own home directory!

 

 


Posted by Anonymous (63.126.xx.xx) on Wed 15 Jun 2005 at 17:49
It looks to me that the debian-way to add users is to rather use 'adduser' rather then 'useradd'.

To quote:


adduser and addgroup add users and groups to
the system according to command line options
and configuration information in
/etc/adduser.conf. They are friendlier front
ends to the low level tools like useradd,
groupadd and usermod programs, choosing
Debian pol- icy conformant UID and GID
values, creating a home directory with
skeletal configuration, running a custom
script, and other features. adduser and
addgroup can be run in one of five modes:

-- deego, somewhat of a newbie.

[ Parent | Reply to this comment ]

Posted by Anonymous (212.225.xx.xx) on Tue 9 Aug 2005 at 07:14
succinct,however one incredibly small quibble- newer debian
versions automatically install home directory with 'adduser' but so what even i figured that out.'chown' useful add on.

[ Parent | Reply to this comment ]

Posted by hardik (61.95.xx.xx) on Tue 30 Aug 2005 at 08:47
[ Send Message ]
I think "adduser" is too good then "useradd", It will cut all this manual stuff.. Then why "useradd"..... With Cheers, Hardik Dalwadi.

[ Parent | Reply to this comment ]

Posted by Anonymous (142.58.xx.xx) on Wed 17 May 2006 at 00:16
I don't know if anyone is watching this article still, but what about creating users when using an LDAP directory? I have been looking for a tool for managing the directory that is not web-based (e.g. LAT) so I've been looking at directory_administrator which seems to be okay but I have to disable schema checking on the LDAP server to use it or else it complains when I try to add/remove users from groups. Anyone have other suggesions? I would prefer a KDE utility.

[ Parent | Reply to this comment ]

Posted by dlepiane (142.58.xx.xx) on Wed 17 May 2006 at 00:20
[ Send Message ]
Sorry, wasn't logged in. Previous post was mine.

"When I read about the evils of drinking, I gave up reading." - Henry Youngman

[ Parent | Reply to this comment ]

Posted by zoombieman (95.34.xx.xx) on Thu 30 Sep 2010 at 23:17
[ Send Message ]
Thanx Alot buddi.. :) i've been serching for ages a way that could help me with this problem..
Using Debian Lenny, but it didn't create the homes for my created users...

newbie, but still learning.. :):)

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1068 votes ~ 7 comments )