Browsed by
Tag: ubuntu server

Two factor authentication for ssh on Ubuntu server

Two factor authentication for ssh on Ubuntu server

Only using a password for ssh might make your server a target for ssh brute force password cracking. Adding two factor authentication for ssh on your Ubuntu server makes this a lot harder for potential hackers.

Google provides a tool called Google Authenticator, which is available for both Android and iOS. This tool acts as a code generator for the two factor authentication.

Every time you login via ssh, the server will prompt you for a code which you read from Google Authenticator.

Read More Read More

Ubuntu server persistent auto reconnecting PPTP VPN connection

Ubuntu server persistent auto reconnecting PPTP VPN connection

I have set up a PPTP VPN client on my Ubuntu server. Unfortunately when the server reboots, the connection goes down and stays down. After a long search I found a solution on this website. It is simple bash script, which checks if the VPN server (which had the VPN ip of 10.8.3.0) is pingable. If not it restarts the PPTP VPN connection.

ping -c3 10.8.3.0 > pingreport
result=`grep "0 received" pingreport`
truncresult="`echo "$result" | sed 's/^\(.................................\).*$/\1/'`"
if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then
pon company-vpn
fi

I execute this script every five minutes, by editing the /etc/crontab file and added the following rule:

*/5 *   * * *   root    bash /root/vpn-check.sh
Server monitoring using Munin

Server monitoring using Munin

Munin is a networked server monitoring tool written in Perl. Munin consists of two parts: the Munin server and Munin nodes. The nodes are running on the servers we want to monitor, while the server periodically (5 minutes by default) fetches the data from all of the registered nodes. The server is a able to build charts from this node data, which gives insight in the cpu usage, disk usage, network load and more.

The Munin team has a live demo of Munin, which can be viewed at http://munin.ping.uio.no/ I have installed both the Munin node and server on my Ubuntu server machine, and added nodes of other servers as well.

Munin screenshot with custom theme
Start Subversion (SVN) automatically when Ubuntu server boots

Start Subversion (SVN) automatically when Ubuntu server boots

It turned out my Ubuntu server does not start Subversion automatically on boot. I found this website with instructions how to create a startup script.

Create a file called “svnserve” in the /etc/init.d folder

$ sudo nano /etc/init.d/svnserve

Add the following line to this script in order to start the Subversion server:

svnserve -d --root /srv/subversion

Save the file (CTRL+O) and exit nano (CTRL+X)
Now make the file executable

$ sudo chmod +x /etc/init.d/svnserve

Add the svnserve script to the init.d boot sequence

$ sudo update-rc.d svnserve defaults

Now you’re done! On the next reboot the SVN server will start automatically.

Readout sensors of an EEE Box running Ubuntu server

Readout sensors of an EEE Box running Ubuntu server

Quintin, a friend of mine, showed me a way to readout the sensors of my EEE Box in Ubuntu server.

The first step is to install the lm-sensors package

$ sudo apt-get install lm-sensors

Then you need to load the w83627ehf kernel module using

$ sudo modprobe w83627ehf

In order to have your sensors detected launch the command below and follow the steps shown (basically you can just press [enter] to each question).

$ sudo sensors-detect

Now you can readout your sensors by using the command

$ sensors

Remember if you want to load the w83627ehf module every time the sysem reboots, you need to update your /etc/rc.local with the line:

modprobe w83627ehf
readout of my sensors
readout of my sensors
Howto install OpenVPN on Ubuntu server tutorial (and connect from OSX clients)

Howto install OpenVPN on Ubuntu server tutorial (and connect from OSX clients)

I have three computers: MacBook Pro, Netbook and a PC. They all have their own data. It would be very nice if I had all my files on just one location (e.g. my server). The only problem is: how do I access these files in a secure way. SSH is an option, but does not quite fit my needs. The solution: NFS over a VPN. NFS fulfilled all my needs, but I do not want to open NFS to whole world through my router.

A VPN, gives me access to my home network and makes it possible for me to access all my files in a secure way. My server (an Asus EEE Box) runs Ubuntu Server, and there is a Linux version of OpenVPN! I thought installing OpenVPN should not be that hard; I just need to find the right tutorial.

openvpn_logo

Read More Read More