User Tools

Site Tools


eg-253:network:step1

Basic Host Configuration

Setting Up the User Accounts

When you installed Ubuntu Linux (whether as a server or desktop client) you created a special administrator's account (usually icct, password swansea). The root user exists, but it is assigned a random password, presumably to discourage naive users from going mad and destroying their newly installed system!

Create a safety net

Before we change the root password (so that we can use it when we need act as the superuser) it is wise to make a few changes to the behaviour of the dangerous commands rm, cp and mv. Log in to the client or server. If on a server, just login as follows:

login: icct
password: *************
[message of the day /etc/motd displayed]
icct@myhost:~$

If on a desktop machine, login through the graphical user interface as icct, then launch a terminal window from Applications → Accessories → Terminal. Now edit /root/.bashrc (you will be asked for a password, use the administrator password swansea): <cli> icct@myhost:~$ sudo nano /root/.bashrc </cli> Add the following lines to the end of the file1)

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
set -o noclobber

Repeat with /home/icct/.bashrc, ~/.bashrc for your own account (if you have one) and /etc/skel/.bashrc. (The latter makes sure that all new users will inherit these settings).

The settings themselves make sure that you will be asked to confirm rm, mv and cp commands if they will cause a file to be deleted or overwritten. The setting noclobber ensures that redirection > and >> will not overwrite an existing file (you have to use >! and >>! to force this to happen).

Setting the root password

To set the root password, use the command:

<cli> icct@myhost:~$ sudo passwd root </cli>

I suggest that we all use the agreed password swansea so that we can all continue to administer the system. Alternatively, you can continue to switch user to icct and continue to issue sudo commands to administer the system.

Create normal users

For day to day use of the system, it is better to create non-privileged accounts. On a desktop machine, the easiest way to do this is by going to System → Administration → Users and Groups. Just use Add User and add yourself. There is no need to add the other students who are using your cluster at this point. We will be setting up a central user registry in a future lab.

If you are using a server, with no windows interface, you have to use the adduser command2):

<cli> icct@myhost:~$ sudo adduser auser Password: * Enter a username to add: auser Adding user `auser'… Adding new group `auser' (1001). Adding new user `auser' (1001) with group `auser'. Creating home directory `/home/auser'. Copying files from `/etc/skel' Enter new UNIX password: * Retype new UNIX password: * passwd: password updated successfully Changing the user information for auser Enter the new value, or press ENTER for the default

      Full Name []: Dr T. Est
      Room Number []: Faraday 799
      Work Phone []: 5990
      Home Phone []:
      Other []: ICCT Level 2 Student

Is the information correct? [y/N] y icct@myhost:~$ </cli>

Check your account

After creating your account, attempt to login. You can do this from a terminal window by using the command:

<cli> icct@myhost:~$ su auser password:

auser@myhost:/home/icct$ cd ~ auser@myhost:~$ exit # or “Ctrl-D” icct@myhost:~$ </cli>

Logging in without "Logging Out"

All Linux distributions allow you to log in to a command line interface without logging out from the window system. If you type <key>Ctrl-Alt-F1</key> you will switch to a full screen command line interface with a login prompt. Each of the function keys <key>F2</key>–<key>F6</key> provides an additional command line interface (<key>Ctrl-Alt-F7</key> is used for the X window interface on Ubuntu). You may find it useful to use one of these additional “console” interfaces for each user who is sharing a machine. To temporarily become an administrator simply issue:

<cli> auser@myhost:~$ su icct password: ** icct@myhost:~auser$ </cli>

Issue the exit command when you are done.

Message of the Day and System Log

When you login to a Unix machine, the system usually displays the contents of the system file /etc/motd (motd = Message of the Day) which is regenerated at every system boot and user login. You can edit a file /etc/moted.tail to customize this system message to include messages that you would want to display to your users when they login. Such messages typically consist of information about the machine itself, (for example to identify the host), contact email for the system administrator, and important changes to the system or planned maintenance, etc. I suggest that you edit this file to customize it for the host you have configured, yourself and your team:

<cli> icct@myhost:~$ sudo nano /etc/motd.tail </cli>

Please ensure that, as a minimum, each member of your team and his/her email address is given and that you point to a system log. The system log itself is to be called /var/log/hostname.log. You should create such a file on each host that you have configured. Each entry is a line of format:

2006-mm-dd log entry

If you want to add more than one line of text, or several entries for the same day, use this format:

2006-mm-dd log entry 1.
         another entry.
         a long entry that goes on and on and needs several lines
         of text.

I would be grateful if you could provide a log entry for each configuration change that you make to your host.


Home | Next Step

1)
Robert Storey, “The Ubuntu Juggernaut, Resistance is Futile”, DistroWatch.com, http://distrowatch.com/dwres.php?resource=review-ubuntu.
2)
Note the username auser is just an example. You should enter a suitable login for yourself
eg-253/network/step1.txt · Last modified: 2011/11/03 14:07 by eechris