Virtual Private Servers (VPS) come pre installed with operating system. Debian Linux is used in this how to. Debian’s apt packages are real time savers and they require minimum work. First thing to do is to install firewall and ntp service. Make a SSH connection with PuTTY to your VPS to install the programs.
PicoFIREWALL is a Linux kernels iptable’s configuration script and it requires minimum work to install and configure. Add the following line in your file /etc/apt/sources.list:
deb http://debian.seismo.ethz.ch sarge ethz_sed
apt-get update; apt-get install picofirewall
PicoFIREWALL is now installed and running, but aknowledge that with default settings picoFIREWALL prevents all incoming connections into the server, including SSH. And since you don’t have a console login for the VPS server you have to make some configuration to be able to login again. Edit /etc/picofirewall/open_log.cfg file and add:
This opens SSH port 22 connection to all ips. You could use your desktop client’s ip and add instead something like:
But remember that your internet connection’s ip might change. If you know any computer you have access and whitch ip is not changin, it might be good backup to add that ip as allowed. I don’t know what is the best solution if you only have a changing ip and you don’t want to make port 22 open to everybody. One might think that services like DynDNS is the answer, but these services don’t make different the fact that your connections ip is still changing and kernels iptables operates only on ip address layer and DNS layer is higher layer.
If and when you want to open the http port 80 edit /etc/picofirewall/open_log.cfg file and add:
After changing picoFIREWALL’s configuration run:
There is no reason why you would not like to have a exact time in your server. So install ntp:
apt-get install ntp apt-get install ntp-server
To set the time first time you have to stop the ntp service, set the time and start the sevice again:
/etc/init.d/ntp-server stop ntpdate pool.ntp.org /etc/init.d/ntp-server start
If you notice that ntpdate won’t change the time of the server, your VPS hardware is propably forcing Linux time synchronization and it is propably not the exact time. Then you have to edit /etc/sysctl.con file and add the line to disable forced synchronization:
xen.independent_wallclock = 1
More info about virtualization’s time synchronization.