Sunday 9 August 2009

A linux machine can be used as a router.

A linux machine can be used as a router.
eg:
you have a system with class A ip address and another system with class B ip address, in that case a linux system can be used to connect these two systems and this system will act as a router.

nodeA: 172.168.1.1
nodeB: 10.10.1.1

the router system should be configured with two or three virtual ipaddress.
one with 10.10.1.2 and another with 172.168.1.2

nodeA: nodeC : node B
Assign the node C with 192.168.1.8
#netconfig -d eth0
then again assign the node C with 2 virtual ip
#netconfig -d eth0:1 ->10.10.1.2
#netconfig -d eth0:2 ->172.168.1.2
assign these two virtual ip as the gateway ip for node A and node B
Assign node A with
#netconfig -d eth0

172.168.1.1 with gateway as 172.168.1.2
Assign node B with
#netconfig -d eth0
10.10.1.1 with gateway as 10.10.1.2
In node C
#vi /etc/sysctl.conf
and replace the line
net.ipV4.ip_forward =0 with net.ipV4.ip_forward =1
#sysctl -p
#service network restart
by doing this the node A can communicate with node B thru' node C

Friday 7 August 2009

User Administration


Types of Users


1) root user -> group id(gid) and user id(uid) is always 0(zero)
2) system users -> gid and uid is from 1-499
3) normal users -> above 500 upto 60,000
user information files are stored in
#cat /etc/passwd
#cat /etc/shadow
#useradd -d (home) -c (comments) -s (shell) -u (uid) -g (gid) -G (secondary uid) -p ("encrypted passwd") username
eg:
#useradd -d /home/user1 -c "a special user" -s /bin/csh -u 500 -g 500 -p "passwd" user1
to encrypt the password before entering
#grub-md5-crypt
User modification:
#usermod username
User Delete:
#userdel username
#userdel -r username with this the content of the password file and home directories are delected