Wednesday, December 16, 2009

Passwordless SSH login

ssh-keygen -t rsa
#save the file in default path (/root/.ssh/id_rsa)
Enter Passphrase ---- make it empty by press Enter
Enter again to continue

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:
02:2c:81:1b:6d:0b:32:c0:23:3c:18:6d:fb:63:b5:d2 root@testserver
The key's randomart image is:
+--[ RSA 2048]----+
|B=. |
|O==o |
|oB+oo |
|. o. .. |
| . o..S |
| = E. |
| . o |
| |
| |
+-----------------+

Copy id_rsa.pub to remote server's /root/.ssh/authorized_keys

Done!

Wednesday, December 9, 2009

Network Teaming

Multiple network interfaces into a single interface

Bind both NIC so that it works as a single device

Linux allows binding multiple network interfaces into a single channel/NIC using special kernel module called bonding

Create a bond0 configuration file

vi /etc/sysconfig/network-scripts/ifcfg-bond0

Append following lines to it:

DEVICE=bond0
IPADDR=192.168.100.20
NETWORK=192.168.100.0
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
BOOTPROTO=none
ONBOOT=yes


Modify eth0 and eth1 config files:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

Add bond driver/module


vi /etc/modprobe.conf

Append following two lines:

alias bond0 bonding
options bond0 mode=balance-alb miimon=100


# modprobe bonding

Restart Network

Done!