20 Aug 2013

Crunchbang Linux - Add a User

When you install Crunchbang Linux the installation invites you to create one user. Although this is often fine sometimes you may need another user id to be created. Follow the steps here to create a user - these steps should work with other similar Linux distributions too.


Add a User
Right click on the desktop, click Terminal
Enter the following command:
sudo adduser <username>
(where <username> is the new user name)

For example, I want to create a user called "fred":
sudo adduser fred    [Enter]

It will prompt you to enter a password twice (once and then to verify you entered it correctly).

Next it will prompt you to enter the full name and other details - you don't need to enter anything, just press Enter. It'll ask you if the information is correct, press Y for yes (see below for an example).


Once it's finished you'll be back at the $ prompt. The new user has been created! You can now login with the user.


Login as the New User
Right click on the desktop, click Exit
Click Logout
Wait...
The usual login screen will appear, login as "fred"
Crunchbang will display a window saying it has added the new user.
Also, once you've finished logging in the following HELLO message will appear:


Previously for the original Crunchbang user you probably already ran this script so just press Q to quit this screen.

As this is a new user you will have to configure the network/wireless and other settings.


Sudo Power
By default a new user does not have administrator (root) power. This means you will not be able to use sudo to run commands in the terminal. This maybe fine for you, this means the new user is restricted, they can't do much damage. However, if you want to give your new user the sudo power, follow these steps:

Exit and Logout
Login as your original user
Right click on the desktop and click Terminal
Type the following:
sudo visudo   [Enter]


Scroll down (use the keyboard arrow keys) to where it says:
# User privilege specification
root    ALL=(ALL)  ALL

Add a line under it as follows:
<username>   ALL=(ALL)  ALL
(where <username> is the new user you created)

In my example (screen shot above) it looks like this:

# User privilege specification
root    ALL=(ALL)  ALL
fred   ALL=(ALL)  ALL

Make sure it is correct, remember that Linux is case sensitive so double check everything you have typed.

Press Ctrl-X to exit
Press Y to save
Press Enter
You will be back at the terminal screen - finished!

No comments: