Friday, July 10, 2009

HOWTO : Rebootless with Ksplice Uptrack on Ubuntu 9.04 Server

By using Ksplice Uptrack, your Ubuntu Server 9.04 will become rebootless even the kernel is updated.

Step 1 :

Get the access key of Ksplice Uptrack at the following link.

http://www.ksplice.com/uptrack/key

The access key will email to you.

Step 2 :

sudo nano /etc/apt/sources.list.d/ksplice.list

Append the following lines to the file.

deb http://www.ksplice.com/apt jaunty ksplice
deb-src http://www.ksplice.com/apt jaunty ksplice

Add the key to repository.

sudo wget -N https://www.ksplice.com/apt/ksplice-archive.asc
sudo apt-key add ksplice-archive.asc

Step 3 :

Install Ksplice Uptrack.

sudo apt-get update
sudo apt-get install uptrack

When installing uptrack, you will be asked for the access key. Go to your email and copy the just received access key to the space provided on the screen.

Step 4 :

sudo nano /etc/uptrack/uptrack.conf

Change the following line and makes Ksplice Uptrack to be installed automatically.

autoinstall = yes

Step 5 :

sudo /etc/init.d/uptrack restart


That's all. See you!

HOWTO : SSH to use RSA key for login

Generate RSA key.

ssh-keygen -t rsa -b 2048

or

ssh-keygen -t rsa -b 4096

“Enter file in which to save the key (/home/samiux/.ssh/id_rsa): (Hit Enter)”

Press “Enter”

“Enter passphrase (empty for no passphrase):”

Enter your password twice.

nano /home/samiux/.ssh/id_rsa.pub

Copy the content.

SSH to your server. At the username directory.

sudo mkdir .ssh
sudo nano /home/username/.ssh/authorized_keys

Then pasted the previous copied key onto the authorized_keys file. Save it.

Still at the server.

sudo nano /etc/ssh/sshd_config

Change the following settings as is.

AuthorizedKeysFile %h/.ssh/authorized_keys
IgnoreUserKnownHosts yes
PasswordAuthentication no
#UseLogin no
UsePAM no

sudo /etc/init.d/ssh restart

When you login to the server again, you will ask for your RSA key passphrase once. Later, you will not be asked for any passphrase or password in the same session.

For Ubuntu Desktop users, you may consider to install SSHMenu. It will make your work more easily.

http://sshmenu.sourceforge.net/
That's all. See you!

HOWTO : Fail2ban on Ubuntu 9.04 Server

Fail2ban cannot work properly with Ubuntu 9.04 Server as Ubuntu installed with Python 2.6. It is very easy to overcome this problem.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python2.5

sudo nano /etc/usr/bin/fail2ban-server

Change the first line from

#!/usr/bin/python
to

#!/usr/bin/python2.5

Set the /etc/fail2ban/jail.conf as usual.

sudo /etc/init.d/fail2ban restart

Make change to the related services to "True". By default, any unauthorized access will be blocked after 6 invalid attempts.

sudo nano /etc/fail2ban/jail.conf

After that, restart fail2ban.

sudo /etc/init.d/fail2ban restart

That's all. See you!