Friday, July 17, 2009

SSH

1. #ssh $USER@$HOST
(Run command on $HOST as $USER (default command=shell))

2. #ssh -f -Y $USER@$HOSTNAME xeyes
(Run GUI command on $HOSTNAME as $USER)

3. #scp -p -r $USER@$HOST: file dir/
(Copy with permissions to $USER's home directory on $HOST)

4. #ssh -g -L 8080:localhost:80 root@$HOST
(Forward connections to $HOSTNAME:8080 out to $HOST:80)

5. #ssh -R 1434:imap:143 root@$HOST
Forward connections from $HOST:1434 in to imap:143)

Make the lights of your NIC blink

If you work on a large network and you get sent to the server room to check out a certain network card, you might get lost in the multitude of network hardware. To find your certain NIC, SSH to the machine in question and do a

#sudo ethtool -o eth0

The lights of the network card should start blinking repeatedly

Flush DNS cache in Linux

If you happened to register a new domain name and you can’t access it, it may be your DNS cache that holds the problem. Here’s how to flush DNS cache in Linux:

#/etc/rc.d/init.d/nscd restart