Archive for June, 2007

SSH Auto Login

Monday, June 25th, 2007

On the client that requires to login to the remote, execute the following command to generate the public and private keys.

[root@localhost ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
3e:b1:6d:44:73:e6:ca:af:3c:06:48:f1:f2:c1:5a:b6 root@localhost.localdomain

append the public key to the remote server
on the client
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwA3AQEAsr8DueNT........... root@localhost.localdomain

on the server
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwA3AQEAsr8DueNT........... root@localhost.localdomain"
>> ~/.ssh/authorized_keys2

You may need to change root@localhost.localdomain to suit your need.

Adding Static Route on Startup

Saturday, June 2nd, 2007

Create if /etc/sysconfig/static-routes does not exist.

# Routing to HK
eth0 net 192.168.2.0 netmask 255.255.255.0 gw 172.16.1.6
eth0 net 192.168.1.8 netmask 255.255.255.248 gw 172.16.1.6
# Routing to Japan
eth0 net 192.168.3.0 netmask 255.255.255.0 gw 172.16.1.1
eth0 net 192.168.4.0 netmask 255.255.255.0 gw 172.16.1.1

set the hardware clock to the current system time

Saturday, June 2nd, 2007


hwclock --systohc