UBUNTU 7.10 SERVER:  POST-INSTALLATION PREPARATIONS

 

 

by Leslie Chong, 8 November 2007

Revised 29 November 2007, Amended B

 

PART I: Check login and network connectivity


Login at the console

 

1-Once you have logged in as the designated user, you can run software at the command line with root privileges by using “sudo…”

 

2-In the Ubuntu server model, the root account is disabled by default.

 

3-Create another account or an account for yourself that can also run “sudo …” using the following steps:

            In the Linux prompt, run (for example):

            $ sudo adduser george

                         Enter and retype a password, enter Full Name, and leave the others blank.

            To add george to the admin group:

            $ sudo adduser george admin

 

4-Logout by typing “logout” at the prompt and login as this newly created user.

 

5-From this command line, some administrators would install, configure and maintain the Ubuntu server.

 

6-To reboot:

            $ sudo reboot

 

7-To shut down:

            $ sudo halt

 

Notes:

 

Q:  As the Ubuntu server boots up, I notice the following in the boot sequence scroll on the screen.

            Setting sensor limits                   [failed]

     How do I fix this?

 

A:  Run the following to try finding the sensors:

            $ sudo sensors-detect

      For example, it may find a fan sensor.  Agree to the defaults.  At the next reboot, the “failed” message should not appear.

 

Check the network configuration

 

1-The server at this stage should be configured for automatic TCP / IP configuration by DHCP.

 

2-To check the network card’s settings:

            $ ifconfig eth0

    The nic should have an IP address from your network’s router or DHCP server.  If it does not, you need to troubleshoot to fix it.

 

3-You can test network connectivity by pinging another computer or the router:

            $ ping –c 4 x.y.z.w (=IP address of another computer on the network, or the IP address of the router / default gateway)

 

Notes:

 

Usually, the network card should be properly configured for DHCP by the installer if you have hooked up the server to the network for the installation.

 

Do not use or enable any wireless network card for a server.

 

Remote console admin

 

Because we installed OpenSSH, we can make a secure remote connection to the server from another computer. 

 

For example, we can connect to the server from another Linux machine using ssh and administer the server remotely:

            $ ssh hostname

or

            $ ssh george@hostname

 

We can also connect from a Windows computer.

 

To do this, download PuTTY for Windows and install it on the Windows machine.  Run PuTTY and connect to the Ubuntu server by typing in the server’s IP address.

 

After typing in the username and password, you’ll get a console of the server on your Windows computer.

 

 

PART II: Building a custom GUI for Ubuntu 7.10 Server

 

Introduction

 

After the Ubuntu 7.10 Server installation,  we are left with a prompt to login to the server.

 

By default, you cannot login as root but you can login as the named user and run administrative tasks which require root access (you run “sudo …” and provide the user’s password).

 

Normally, the server can be run as such.  Server software would be installed and configured via the CLI.

 

There are various ways to do admin remotely including secure SSH clients mentioned  above and Webmin (see Part III):

 

GUI for a server

 

The Ubuntu Desktop version installs Ubuntu with the GNOME desktop, full of goodies and applications for the desktop user.  The Kubuntu version installs a desktop Linux with the KDE  desktop environment.  The Xubuntu distribution installs to a Xfce desktop environment, which is a minimalist environment.

 

You can install any of these and other desktop environments over your server, but you will end up with a complete desktop on the server.  You really do not want to do this for a production server.

 

To have GUI on top of a base Linux installation (like the Ubuntu server which gives you a prompt and other virtual consoles), you need to install the following components (examples in brackets):

a)-The X window environment, the platform for Linux GUI environment (X org)

b)-A window manager (Fvwm, Icewm, Fluxbox …) or an integrated (with its associated window manager) desktop environment (GNOME, KDE, Xfce …)

c)-A display manager cum login manager (gdm, Kdm, xdm)

 

We do not want a full desktop, so what we really should do is to customize a desktop with the minimum applications we want to run from the GUI.  The approach I have adopted is to use the efficient Xfce desktop (least memory footprint), and install it without the unwanted packages to make it even leaner.

 

Steps to install a customized GUI for the server:

 

While logged in as the privileged user:

 

1-Update the list of sites for packages by typing:

            $ sudo apt-get update

 

2-Install the X window platform, the foundation for Linux GUI:

            $ sudo apt-get install xserver-xorg  xorg ttf-bitstream-vera x-ttcidfont-conf

    The configuring xserver-xorg screen comes up.  Choose 1024x768 using the space bar and tab to <Ok>, Enter.         

 

3-Install Xfce desktop environment:

            $ sudo apt-get install xfce4 xfce4-appfinder xfce4-artwork

 

4-Instead of the X display manager (xdm), install the GNOME (gdm) version and some tools:

            $ sudo apt-get install gdm feisty-gdm-themes ubuntu-artwork gnome-system-tools

 

5-Install some applications:

            $ sudo apt-get install synaptic gnome-terminal gedit firefox thunderbird xpdf abiword mousepad

 

6-Reconfigure the xorg file:

            $ sudo dpkg-reconfigure xserver-xorg

    Unless you have the specific information for your video card, keyboard and mouse, it is best to choose the defaults.

    Choose the base resolution of 1024x768.

 

7-Bring the installed packages up to date:

            $ sudo apt-get upgrade

 

8-Reboot the server to GUI:

            $ sudo reboot

 

9-Xfce GUI Basics:

 

            Click on right mouse button for the Menu.

            Try opening different packages on the desktop.

            You can minimize an application by clicking on the up arrow icon on the top right of the application window.  (You can open it up again by clicking on the down arrow there.)

 

            If your current desktop is cluttered, you can choose to work in another workspace.  Click on the middle mouse button, and pick another workspace and run other applications there.

 

            You can go to another console by pressing Ctrl-Alt-F2 (or F3, F4, F5, F6).  Ctrl-Alt-F7 brings you back to your GUI console.

 

            To restart or shut down, right-click and pick Quit, and then Restart or Shut down.

 

Q & A:

 

Q:  How do I make the font larger in Firefox?

A:  Press Ctrl and + buttons to increase the size.

     Press Ctrl and – buttons to decrease the size.

 

 

PART III: Download and install Webmin and ClamAV Anti-virus

 

Webmin

 

Webmin is a web-based server configuration and admin tool for Linux / UNIX.

 

To install it:

1-Install Perl and library packages:

            $ sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl  libmd5-perl

 

2-Download Webmin:

$ wget http://prdownloads.sourceforge.net/webadmin/webmin_1.370_all.deb

 

3-Install Webmin:

            $ sudo dpkg –i webmin_1.370_all.deb

 

4-Login to Webmin from a browser, e.g.

            https://server_name:10000  or https://x.y.z.w.:10000 (x.y.z.w = server’s IP address)

 

5-Logout after exploring the Webmin interface.

 

ClamAV Anti-virus

 

1-Install ClamAV:

$ sudo apt-get install clamav clamav-daemon clamtk

 

2-Perform an initial virus definition update:

            $ sudo freshclam

 

3-You can try out a manual scan using Virus Scanner from the Menu (under Accessories).

 

4-ClamAV does not have a native real-time monitor, so you should set up a schedule for a periodic scan by ClamAV (for example, if you use your Ubuntu machine as a regular computer):

            $ sudo mousepad /etc/crontab

and add this line to the file, and save it:

            00 23 * * * root clamscan /home –r –i –l  /var/log/clamav/clamscan.log

(This sets up a scheduled scan of the /home directory and sub-directories at 11:00 pm everynight.)

or something like:

00 23 * * * root clamscan /data –r –i –l  /var/log/clamav/clamscan.log

(here /data is your data folder).

 

5-After the first scan (which can be a manual scan that you do by $ sudo clamscan /home –r –i –l  /var/log/clamav/clamscan.log to create the log file), the clamscan.log file will be created.  You need to change its properties:

            $ cd /var/log/clamav/

            $ sudo chgrp admin clamscan.log

            $ sudo chmod g+w clamscan.log

 

6-You can use Thunar File Manager to check the log for any virus detection.  You can also do a quick inspection of the log by:

            $ cat /var/log/clamav/clamscan.log

If there is virus detection reported, take the appropriate action.