4 февр. 2012 г.

SSH Port Forwarding (SSH Tunneling)

Syntax: # ssh -L localport:host:hostport user@ssh_server -N where:
-L - port forwarding parameters (see below)
localport - local port (chose a port that is not in use by other service)
host - server that has the port (hostport) that you want to forward
hostport - remote port
-N - do not execute a remote command, (you will not have the shell, see below)
user - user that have ssh access to the ssh server (computer)
ssh_server - the ssh server that will be used for forwarding/tunneling

Without the -N option you will have not only the forwardig port but also the remote shell. Try with and without it to see the difference.

How to setup a Linux VNC Server with KDE or Gnome

The default desktop for the VNC Server is "TWM", though most people are used to KDE or Gnome instead. Here is how to change it:

1. Edit ~/.vnc/xstartup
2. For KDE, replace "twm &" with "startkde &"
3. For Gnome, replace "twm &" with "exec gnome-session &"
4. Kill any existing VNC servers with "vncserver -kill :1" where 1 is the display number.
5. Start a new server.

How to export NFS share on Linux

To export a directory/NFS share from Linux you need to have nfs server installed and have nfs services running on your linux (Fedora/CentOS/RHEL) machine.

Checking NFS server status:
Check to see if you have NFS services running on your Linux machine: # ps -aef | grep nfsd
# root 13397 7 0 08:21 ? 00:00:00 [nfsd4]
# root 13398 1 0 08:21 ? 00:00:00 [nfsd]
# root 13399 1 0 08:21 ? 00:00:00 [nfsd]
# root 13400 1 0 08:21 ? 00:00:00 [nfsd]
# root 13401 1 0 08:21 ? 00:00:00 [nfsd]
# root 13402 1 0 08:21 ? 00:00:00 [nfsd]
# root 13403 1 0 08:21 ? 00:00:00 [nfsd]
# root 13404 1 0 08:21 ? 00:00:00 [nfsd]
# root 13405 1 0 08:21 ? 00:00:00 [nfsd]

Installing Webmin on CentOs 5

I just installed the latest version of webmin on my CentOs 5 server.
I have not used webmin in about 2 years, I can not believe how much the interface has improved.

Webmin is a GUI control panel that lets you administer a Linux box.

Here is all you need to do to get it installed:
This will install some dependencies. # yum -y install perl-Net-SSLeay Install the system: # cd /usr/src
# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.510-1.noarch.rpm
# rpm -i webmin-1.510-1.noarch.rpm

Restore GRUB

Boot a cd with rescue linux.
Issue this:
as root
grub (enter)
root (hd0,?) (? being where your controlling distro is, in my case it was 5)
setup (hd0)
quite


Done!