A step by step guide to implementing an Ultra-Secure Ubuntu Server
This document describes the process of installing an Ubuntu Server.
The information provided is biased towards the Ubuntu Karmic Koala (Ubuntu 9.10) version, but should work with newer versions too.
Additional steps should then be taken to harden the server to ensure compatibility with PCI Compliance standards.
The Ubuntu 9.10 server CD, available here: http://releases.ubuntu.com/releases/9.10/ubuntu-9.10-server-i386.iso (i386)
or http://releases.ubuntu.com/releases/9.10/ubuntu-9.10-server-amd64.iso (x86_64)
A fast Internet connection.
Information, such as the following, is required:-
| Network Comms | Example Details |
|---|---|
| Hostname | db1.sharewiz.net |
| Gateway | 192.168.40.254 |
| NIC 1 IP Address | 192.168.40.21 |
| NIC 2 IP Address | 192.168.40.22 |
Insert your Ubuntu install CD into your system and boot from it.
1. Choose the Language for the final system.
2. Select the installation type - Select "Install Ubuntu Server".
3. Select the language to be used during the installation process.
4. Select your location.
5. Choose the Keyboard Layout. You will be asked to press a few keys, and the installer will try to detect your keyboard layout based on the keys you pressed.
6. Select the Primary Network Interface, i.e. eth0.
7. The installer then checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network.
8. If DHCP is not found, select the "Configure Network Manually" option, and configure with the requested fields.
9. Enter the hostname. If the system is to be called db1.sharewiz.net, enter db1.
10. Enter the domain name. Enter sharewiz.net.
11. The system will attempt to set the clock and will try to get the time from a network time server. This will take a time, and the system will probably not be successful in doing this, as it will not have external internet access. Ignore the error.
12. Now you have to partition the hard disk. We want to use Logical Volume Manger, or LVM, which allows administrators to create logical volumes out of one or multiple physical hard disks. LVM volumes can be created on both software RAID partitions and standard partitions residing on a single disk. Volumes can also be extended, giving greater flexibility to systems as requirements change. There are several installation options for LVM, "Guided - use the entire disk and setup LVM" which will also allow you to assign a portion of the available space to LVM, "Guided - use entire and setup encrypted LVM", or "Manually setup the partitions and configure LVM". At this time the only way to configure a system with both LVM and standard partitions, during installation, is to use the Manual approach. Remember that there can be a maximum of 4 primary partitions per disk.
13. Configuring LVM in Ubuntu takes place in 5 steps
14. Select "Manual" to manually partition the disk on the system. Note that if you select any one of the "Guided" options for LVM configuration, all the available disk space will be used up, leaving you no free space to grow any logical volume if or when the need arises. Ultimately, our goal is to use just enough space to get the system up and running, and leave the rest for when we need to grow logical volumes.
15. If partitions already exist, then select the existing partitions and delete them.
16. Create a standard (non-LVM) primary partition for the /boot file system.
17. The next step is to use the unallocated space to create a physical volume.
18. A Physical volume is the first major component of LVM, and can be created from a disk partition or a full disk drive. To create the PV for this configuration, we are going to use the unallocated disk space.
19. The next step is to create a Volume Group (VG).
20. Next, create the Logical Volumes. With the PV and VG created, and the PV assigned to the VG, the next step is to create the Logical Volumes. A Logical Volume (LV) is LVM jargon for partition. We will create a number of LVs, one each for the following file-system directories:-
21. The final task is to assign a file-system and a mount point to each LV.
22. Finally, select "Finish partitioning and write changes to disk". Then confirm the changes and continue with the rest of the installation.
23. Afterwards, your new partitions are being created and formatted.
24. Now the base system will be being installed. Note that this may take a while. The ALT-F4 key combination can be used to monitor what is actually happening with the install process. Use the ALT-F1 key combination to return back to the normal install screen.
25. Create a user, for example the user Administrator with the user name administrator (IMPORTANT:- don't use the user name admin as it is a reserved name on Ubuntu 9.10).
26. We don't need an encrypted private directory, so choose No here.
27. Next the package manager apt gets configured. Leave the HTTP proxy line empty unless you're using a proxy server to connect to the Internet.
28. The system will probably seem to pause for a long time (due to the fact that it cannot yet get external internet access). This is optional, but to speed up the install a bit, press Enter to cancel current step - and the graph should jump to around 80% completed. Enter can be pressed once more to skip to the end of this step).
29. To update the server manually in order to have more control, select No automatic updates.
30. A choice of different types of server servers can be selected, but nevertheless don't select any of them now in order to have full control over what gets installed on the system. The packages required on the system will be manually installed later on. The only item to select here is OpenSSH server so that one can immediately connect to the system with an SSH client such as PuTTY after the installation has finished.
31. The installation continues.
32. The GRUB boot loader gets installed.
33. The base system installation is now finished. Remove the installation CD from the CD drive and hit Continue to reboot the system.
After the reboot you can login with your previously created username (e.g. administrator). Because we must run all the next steps from this document with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing:-
sudo -i
For a global http proxy, add this line to the /etc/environment file:-
http_proxy=http://192.168.5.2:3128
and this will be enabled at boot.
If you did not install the OpenSSH server during the system installation, you can do it now.
Issue the following command:-
sudo aptitude install ssh openssh-server
Issue the following command:-
sudo aptitude install vim-nox
Because the Ubuntu installer has configured the system to get its network settings via DHCP, we have to change that now because a server should have a static IP address. Edit /etc/network/interfaces and adjust it to your needs (in this example setup the IP address 192.168.40.21 is used).
Issue the following command:-
sudo vi /etc/network/interfaces
To enable the new settings to be recognized, the network needs to be restarted
Issue the following command:-
sudo /etc/init.d/networking restart
Edit the /etc/hosts file.
Issue the following command:-
sudo vi /etc/hosts
Then edit the /etc/resolv.conf file.
Issue the following command:-
sudo vi /etc/resolv.conf
Issue the following command:-
echo db1.sharewiz.net > /etc/hostname
To enable the new network settings to be recognized, restart the system
Issue the following command:-
sudo reboot
Issue the following command:-
hostname
hostname -f
Both should show db1.sharewiz.net now.
Please be patient....finished soon...


times since 3 March 2011