How to set VNC

 VNC is useful to remotely to control one computer .

1. Install 

    yum install vnc vnc-server

2. Setting the vnc account

    edit the file : "vim /etc/sysconfig/vncservers"

    VNCSERVERS="1:root 2:roc"

3. Set the password for the different account

    As root user , run "vncpasswd" command to set the password;

   Then run the command again as roc user.

4. Start the servers

    service vncserver start

5. Test it by vncviewer

    vncviewer localhost:1  or vncviewer localhost:2

   It should be work.

6. Open the firewall to be  access by other users

      6.1   vim  /etc/sysconfig/iptables

       Add below two lines in that file

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT 

     6.2  Apply the new rules for the firewall

         service iptables restart

7. Then other users can access it in remote.

    vncviewer ip:1 

    if you cant access it , you can stop the iptable to try it again. ( service iptable stop)

Note:

 1. Some other remote control tools are also useful. Such as screen, tsclient, mstsc , rdesktop. The later three ones are access the window os, which mostly like mstsc.

2. Screen command:

   2.1 Create the name termeral:

       screen -S  XXX

   2.2 Share the terminal

       screen -x XXX

   

 

    

你可能感兴趣的:(set)