SSH & VNC
Remote Access lets you to connect other computer that are located over the network.
Makes your life easier to manage nodes remotely you don’t need to be there physically you can connect your node through remote access, for command-line remote access Linux provide us SSH (Secure SHell) if you are looking graphical remote environment then VNC (Virtual Network Computing ) is there to serve.
what is ssh ?
Its Secure SHell that provides encrypted tunnel from your computer to remote computer. SSH is secured with encryption so you don’t need to be worried when you are on SSH.
More secure ssh connectivity.
ssh is inherently secured but at the same time if your server is online its always better you give access to fewer users who can connect over the wire using ssh. as we know ‘root’ is super user its recommended only use ‘root’ when you need to perform administrative tasks.
so you can restrict SSH to non-privileged users.
In main config file of ssh that is located on ‘/etc/ssh/sshd_config’ you can see the default options using cat.
By default user ‘root’ is allowed to connect.
In order to make ssh more secure we can change ‘PermitRootLogin no ‘ this will give us a chance to monitor ‘root’ usage when someone try to use ‘su root’ because ‘su’ logs an entry in log.
[[email protected] ~]# vi /etc/ssh/sshd_config PermitRootLogin no
you need to restart the ssh service in order to changes takes effect.
service sshd restart
How to connect using ssh ?
You can establish a ssh connection using this command ‘ssh [email protected] or IP’
[[email protected] ~]# ssh [email protected] Last login: Tue Jun 19 07:25:39 2012 from 192.168.2.229 [[email protected] ~]$
How to connect Linux from windows via ssh ?
For the sake of this purpose you can download ( Putty ) software that is freely available on internet.
What is VNC ?
VNC ( Virtual Network Computer ) also for remote access, ssh is available for command line remote access and in order to get graphical environment of remote pc such as you are sitting in front of that pc, you can use vnc. VNC uses ( 5900-590x ) port numbers. Tigervnc is available in CentOs 6.2 for graphical remote sessions.
How to Install tigervnc-server on CentOs 6.3 ? < see this tutorial
yum install tigervnc-server
Edit config file’s last two lines.
[[email protected] Desktop]# vi /etc/sysconfig/vncservers
# Use "-localhost" to prevent remote VNC Clients. VNCSERVERS="2:root" VNCSERVERARGS="-geometry 800x600 -nolisten tcp"
Add vnc on start up.
[[email protected] Desktop]# service vncserver start
How to connect with vnc ?
how to connect your linux box from a linux client.
vncviewer ip or hostname:2
Note : If you are using winodws you can connect your Linux box using RealVnc.