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!
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 ]
versions automatically install home directory with 'adduser' but so what even i figured that out.'chown' useful add on.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
"When I read about the evils of drinking, I gave up reading." - Henry Youngman
[ Parent | Reply to this comment ]