Tablets How to configure VNC on CentOS 6.5 | BLOG IT

How to configure VNC on CentOS 6.5



In order to take control over your Linux computers it's very recommendable to install and configure the VNC Server, the following article shows the step-by-step.

Review if you already have installed VNC with the following command:
rpm -q tigervnc-server

To install execute:
yum install tigervnc-server
yum groupinstall Desktop

Create users on Linux which will access the computer, if you already have the users omit this step:
 su - 
useradd larry

passwd larry

Where su - indicates to change your current user to use the root user, after that you need to type the password, and useradd will add the user with the name you prefers for example: larry, then passwd is the password for the user.

Edit file named VNCSERVERS to indicate the name of the user which will access and the screen resolution to use:
Gedit /etc/sysconfig/vncservers

You could use the following lines as example to provide access to larry, mich and tom with different resolution:
VNCSERVERS="1:larry 2:mich 3:tom"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 640x480"
VNCSERVERARGS[3]="-geometry 800x600"

Now is time to create the user's VNC password:
su - larry (this command changes to use the user named larry)
Vncpasswd (with this command you will introduce the password )
cd .vnc (change to vnc directory )
Ls (list files and observe that exists the file named: passwd)

Now start, stop and configure to automatically initialize the service:
/sbin/service   vncserver start
 /sbin/service   vncserver stop
 /sbin/chkconfig vncserver on

Then edit IPtables in order to permit the connection to VNC:
Gedit /etc/sysconfig/iptables

Add the following line to the file which will permit connection from ports range 5901:5903 and 6001:6003:
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT

Finally restart IPtables service:
/sbin/service iptables restart

Now connect for example with VNC Viewer:


On the last screen at the VNC Server field you type the IPaddress for your Linux computer (192.168.0.26) the you type the number corresponded to user configured on your VNCSERVERS file which also corresponds to the port used on the IPTables file in this case 5902. Finally click connect, and if you receive the following message click on Continue:



You will be asked for the password for user defined on connection number 2 on the VNCSERVERS file:

Finally introduce your credentials for Linux, also you have some options at the top of the screen for VNC viewer as maximize screen or disconnect:

Now enjoy your remote connection to your Linux computer!


SHARE

About Robert SA

    Blogger Comment
    Facebook Comment

0 comentarios: