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!