This document describes the process of installing an Ultra Secure Ubuntu Server.
The information provided is biased towards the Ubuntu Trusty Tahr (Ubuntu 14.04 LTS) Server version, but should work with other versions too - perhaps with a few tweaks.
Additional steps should then be taken to harden the server to ensure compatibility with PCI-DSS Compliance standards.
Ubuntu server is well designed, regularly updated and relatively secure. The Ubuntu Security Team manifests an ongoing effort to keep Ubuntu secure. Regular security updates are available and easy to implement.
By default, Ubuntu Servers are secured as follows:
Securing Ubuntu is not very different from securing any other system; In order to do it properly, you must first decide what you intend to do with it. After this, you will have to consider that the following tasks need to be taken care of if you want a really secure system.
The tasks can also be thought of as:
Hardening is a process which aims at securing a system; absolute security is impossible to reach but reducing the surface attack and reaching an equilibrium between security and cost (where with cost we refer to implementation, maintenance and usability costs) is possible.
Hardening a server means, at the practical level, reducing as much as possible the attack surface, and monitoring what is exposed to detect intrusion.
Hardening a system is much easier if you start from a minimalistic system and then add only the needed services. Hardening a complex system is possible but has a higher cost and is much more complicated, since it is easy to forget some (apparently) harmfulness piece of software somewhere in the machine. Even with modern packet managers, handling installed packages isn't an easy task.
To achieve a state of security:
The system will include: system analysis, changing settings for additional hardening against attack, installing a firewall maintenance system, scanning for rootkits, and offering a regular maintenance regimen.
The Ubuntu 14.04 LTS server CD, available here:
A hard disk with a minimum of 20G capacity.
A fast Internet connection.
A server with at least two ethernet cards.
Note that these instructions can still be used if the server only has a single network card. Notes will indicate where minor changes needs to be made to accomodate this.
Having only a single network card will result in a slightly weaker system, but it should still be very secure, so not a major concern.
Items in RED should be changed to meet your requirements.
|Admin ID||administrator||This is the username of the primary administrator.|
|Admin Password||adminpass||Recommended to use a strong password.|
|Admin Group||admin||This is the group that all administrators will belong to.|
IMPORTANT: Do not use the user name admin for the Admin ID as it is a reserved name on Ubuntu 12.04.
|IP Subnet Mask||255.255.255.0|
The IP Address, Subnet Mask and Gateway will probably be provided by your ISP if you have a static IP Address.
If the IP address is returned by your router's DHCP server, then use those settings instead.
|IP Subnet Mask||255.255.255.0|
IMPORTANT: If the system only has one network card, then use eth0:0 as the Interface in place of the eth1 throughout this document unless specifically indicated otherwise.
Do not include a Gateway option onto the internal interface. With it in there, and being the 2nd default gateway that gets configured, it will likely replace or override the 1st gateway on eth0 when the system is initialized, and that path won't work through the router.
|DNS Server||IP Address|
|External DNS Server1||126.96.36.199|
|External DNS Server2||188.8.131.52|
184.108.40.206 and 220.127.116.11 are Google's DNS servers. If you wish to use your ISP's DNS servers, use them here instead of Googles servers.
18.104.22.168 and 22.214.171.124 could also be used. They are the OpenDNS DNS servers.
|DNS Server||IP Address|
|Internal DNS Server1||192.168.1.201|
|Internal DNS Server2||192.168.1.202|
Multiple DNS servers are recommended to support if one goes down.
These settings are only required if a network bonding / network teaming will also be used.
Network bonding allows multiple network interface cards (NICS) to appear to be the same physical device and also to have the same MAC address. Linux uses a special kernel module called bonding to allow users to bond multiple network interfaces into a single channel.
Bonding effectively aggregates the bandwidth of multiple interfaces into a single connection.
Bonding is used primarily to provide network load balancing and fault tolerance; and is also a way to increase available bandwidth.
Network Bonding may also be called Network Teaming or occasionally Port Trunking.
The bond-primaries should include all interfaces connected to the WAN.
In order to use network bonding with this setup, at least 3 network interface cards need to exist. 2 to connect to the WAN, and at least 1 to the LAN.
Note that you cannot bond the WAN (eth0) and LAN (eth1).
These settings are only required if specific applications are installed.
|Primary Domain Controller||pdc.sharewiz.net||If using a Domain Controller this will point to the primary DC.|
|Secondary Domain Controller||sdc.sharewiz.net||If using a Domain Controller this will point to the secondary DC.|
|HTTP Proxy Server||http://192.168.5.6:3128||If a proxy server is used for HTTP.|
|NTP Server IP Address||192.168.5.6||If using a NTP server to get standard date/time for the system.|
|Remote Email Server||192.168.5.25||If using a remote server to deliver emails.|
|Admin Email Addressfirstname.lastname@example.org||Email address of the System Administrator.|
|MySQL Root Password||mysqlrootpass||If using MySQL or Maria SQL.|
|Windows Share ID||windowsid||The ID to use to access the Windows share.|
|Windows Share Password||windowspass||The password to access the Windows Share.|
Use a design that allows for dynamic growth and fine-tuning.
This prevents volumes becoming completely full, which is a definate no!
The Logical Volume Manager (LVM) is used, which lets you add disks, replace disks, copy and share contents from one disk to another without disrupting service (hot swapping).
The following volume will remain outside the LVM.
|/boot||/boot||256 MB||boot volume - This will remain static in size. It is also the only space residing outside the Logical Volume Manager (LVM)|
The following volume will be within the LVM.
|Logical Volume||File System||Size||Comments|
|/dev/vg01/swap||swap||4 GB||swap volume - Set to twice the amount of memory in the system. This should remain static in size, however, if the amount of RAM is adjusted, this should be adjusted as well.|
|/dev/vg01/root||/||2 GB||root volume - Operating system and everything else which should remain fairly static.|
|/dev/vg01/usr||/usr||2 GB||usr volume - Contains by far the largest share of data in the system.|
|/dev/vg01/var||/var||2 GB||var volume - This is the database/log storage area and will continue to grow over time.|
|/dev/vg01/tmp||/tmp||2 GB||tmp volume - This location will be used for temporary storage. Adjust size as required.|
|/dev/vg01/srv||/srv||0.5 GB||srv volume - This will contain the files stored in the Samba share.|
|/dev/vg01/opt||/opt||0.5 GB||opt volume - This location is occasionally used for specific software.|
|/dev/vg01/home||/home||0.5 GB||home volume - This is where personal user files will be stored.|
|/dev/vg01/backup||/backup||4 GB||backup volume - This will contain a local backup of any databases and other important data, so space needs to be around double /var.|
|/dev/vg01/sharewiz||/sharewiz||0.5 GB||sharewiz volume - This will contain scripts used to administor the system, and should remain fairly static.|
Even though the above sizes will fill most of a 20GB hard drive, it it recommended to still use the same sizes even if you have a far bigger drive.
The system will auto grow the necessary partitions as required.
The exception to this is for the /var partition, which could be made much bigger if you know for instance that a large database will be installed into it.
If you do increase the size of the /var partition then remember to also increase the size of the /backup partition accordingly.
See Disk Security for further information.