Tuesday, August 24, 2010

Force Console Login to logout

If somebody forgot to log-off their console session, you can logout it remotely.
$ ps -ef | grep login

Kill that process

$ kill xxxx

Monday, June 2, 2008

CENTOS 5.1 netconfig deprecated

Yes netconfig on CentOS 5.1 has been removed, here is how you do it now.

to set your ip, in you command line

# system-config-network

Then you will be asked which eth you would like to modify. Select the eth then press enter. Set in the data needed and select OK then you will be back at your previous page, finally select quit. Dont restart the network yet.

The second step is to set your DNS. you can use vi, mine is nano

# nano /etc/resolv.conf

Then enter your DNS eg.

nameserver 192.168.1.1

If there is other text in it, remove it then replace it with a format mentioned above. dont forget to make a backup. If you are setting up multiple DNS, you may want to read the previous post I made just before this.

Finally restart the network

# service network restart

Then check if your settings work ny using ping ie.

# ping wwww.google.com


Thats it for this post. :D cheers

Wednesday, March 5, 2008

How to set the DNS on linux having multiple eth

You have to edit resolv.conf with your favorite text editor, mine is nano.
First you might want to backup your existing file.
To back up, just do this
$cp /etc/resolv.conf /etc/resolv.conf.bak

$ nano /etc/resolv.conf

Replace anything in it. Dont forget to back up first.
The format would be
nameserver $DNS$

e.g
nameserver 192.168.0.1

if you have multiple dns that you would like to define, then just append it to the next line.

e.g

nameserver 192.168.0.1
nameserver 192.168.1.1

save it and exit the editor
(in nano you can exit and save it by pressing ctrl+o, then you will be ask of the filename, just press enter, then press ctrl+x to exit the editor)

Then last is to restart the network

$service network restart

Check if it works for you, try to ping other pc on your network else if you are trying your linux to connect to internet try to ping www.google.com

$
ping www.google.com

End of my notes....