VNC for remote management and vnc for Remote Management

Source: Internet
Author: User

VNC for remote management and vnc for Remote Management

Basic concepts of Remote Management

RDP (remote desktop protocol) protocolRemote Desktop Protocol. The common windows operating system is the Remote Desktop Management Based on this Protocol. For more information about the RDP protocol, see Baidu Baike RDP.

TelnetThe remote management tool in the CLI interface has a long history and is available in almost all operating systems (telnet transmits data in plaintext without encryption, currently, almost no telnet is used for remote management.) telnet

SSH (Secure Shell) ProtocolAlmost all operating systems of the remote management tools in the CLI interface (unlike telnet, SSH encrypts data during data transmission, so SSH is a secure protocol ), almost all UNIX-like operating systems use SSH for Remote Management (Linux, BSD, Mac OS, etc ). SSH

RFB (Remote FrameBuffer) ProtocolThe graphical Remote Management Protocol (VNC) is based on this Protocol. The above mentioned SSH is a common Remote Management Method on the CLI in UNIX-like environments, in UNIX-like operating systems, graphical remote management tools also exist. VNC is a common graphical remote management tool in UNIX-like systems. VNC

 

VNCOverview 

VNC (Virtual Network Computing) is short for Virtual Network computers. VNC is an excellent remote control tool software developed by the famous AT&T European research laboratory. VNC is a free open-source software based on UNIX and Linux operating systems. It has powerful remote control capabilities and is highly efficient and practical. Its performance can be comparable to any remote control software in Windows or MAC. In Linux, VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect. In most cases, only two commands are required: vncserver and vncviewer. Currently, the original AT&T version is no longer used, because more branch versions with significant improvements have emerged, such as RealVNC, VNC tight, and UltraVNC. Real VNC is currently the most active and powerful mainstream application.

VNCPrinciple

The VNC system consists of a client, a server, and a protocol. The VNC Server aims to share the screen of the machine on which it runs, and the server passively allows the client to control it. The VNC client (or Viewer) observes and controls the server and interacts with the server. The VNC Protocol (RFB) is a simple Protocol that transmits the original image of the server to the client (a square dot matrix data on X and Y), and the client sends event messages to the server.

In the simplest case, the VNC protocol uses a large amount of bandwidth, so various methods have been invented to reduce communication expenses. For example, there are a variety of coding methods to determine the most efficient way to transmit these lattice blocks)

The protocol allows the client and the server to use which encoding will be used. The simplest encoding is supported by most clients and the server. The original encoding of scanned data is from left to right pixels, when the original full screen is sent, only the changed Square area is sent. This encoding works very well when there are only a small number of screen changes in the cursor (for example, when the mouse is moving on the desktop or hitting the text at the cursor ), however, if a large number of pixels change at the same time, the bandwidth will increase very high, such as dragging a window or watching full screen video.

By default, VNC uses TCP ports 5900 to 5906, while java vnc clients use 5800 to 5806. A server can connect to a client in "listening mode" at port 5500. One advantage of using the listening mode is that the server does not need to set a firewall.

VNC on UNIX is called xvnc and plays two roles at the same time. For applications in the X Window System, it is an X server, and for the VNC client, it is a VNC server program.

 

Lab Environment

VNCServer:

Operating System: Red Hat Enterprise Linux Server release 5.7 (Tikanga)

VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect.

VNCClient:

Operating System: Windows 7 Professional Edition 64-bit Operating System

 

VNC installation Configuration

1Install the VNC package

[Root @ localhost/] # cd/mnt/cdrom/Server

[Root @ localhost/] # rpm-ivh vnc-server-4.1.2-14.el5_6.6.x86_64.rpm

[Root @ localhost/] # rpm-ivh vnc-4.1.2-14.el5_6.6.x86_64.rpm

Verify that the vnc-server package is successfully installed:

[Root @ localhost/] # rpm-qa vnc-server

Vnc-server-4.1.2-14.el5_6.6

[Root @ localhost/] # install tigervnc-server.

2, Configure the vncservers File

Modify the/etc/sysconfig/vncservers file, uncomment the configuration information of the last two lines, and add the system account.

# The VNCSERVERS variable is a list of display: user pairs.
#
# Uncomment the lines below to start a VNC server on display: 2
# As my 'myusername' (adjust this to your own). You will also
# Need to set a VNC password; run 'man vncpasswd' to see how
# To do that.
#
# Do not run this service if your local area network is
# Untrusted! For a secure way of using VNC, see
# <URL: http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting tables t when
# Doing so through a secure tunnel. See the "-via" option in
# 'Man vncviewer 'manual page.

VNCSERVERS = "1: root 2: zzhz" # modify Information

VNCSERVERARGS [1] = "-geometry 1024x768-nolisten tcp-nohttpd" # modify Information

VNCSERVERARGS [2] = "-geometry 1024x768-nolisten tcp-nohttpd" # modify Information

Note: VNCSERVERS is used to set the server accounts that can use VNC. Multiple server accounts can be set, such as root and etl, but must be separated by spaces. When you log on with VNCVIEWER, 192.168.48.128: 1 indicates that you log on with the root account, and so on.

Parameter configuration instructions:

1:-geometry indicates the desktop resolution. The default value is 1024x768, so the above 1024x768 can also be left empty.

2:-nohttpd indicates that HTTP port (58xx) is not monitored ).

3:-nolisten tcp indicates that the TCP port is not listened to (60xx)

4:-localhost only runs access from the local machine.

5: By default, AlwaysShared allows only one VNCVIEWER connection. This parameter indicates that multiple users can log on to the same display port simultaneously.

6:-depth indicates the color depth. The parameters are 8, 16, 24, and 32.

7: SecurityTypes None login does not require password authentication VncAuth default value, password authentication is required.

3. Set VNC User Password

If the VNC user password is not set at this time and the vncserver service is started, the following error is reported:

[Root @ localhost ~] # Service vncserver start

Starting VNC server: 1: root [FAILED]

[Root @ localhost/] # vncpasswd

Password:

Verify:

[Root @ localhost/] # su-zzhz # When passwords are generated for different accounts, an xstartup file is also generated.

[Zzhz @ localhost ~] $ Vncpasswd

Password:

Verify:

4. Start the vncserver service

[Root @ localhost ~] # Service vncserver start # The service will be automatically disabled after restart

[Root @ localhost ~] # Chkconfig vncserver on # automatically start the service upon startup

 5. Configure the xstartup File

VNC generates a series of files under the ". vnc" folder under the user root directory ($ HOME. Passwd is the vnc user password file generated by vncpasswd. Other scripts are generated when vnc is started for the first time and xstartup is the script started when the VNC client is connected.

[Root @ localhost Server] # cat/root/. vnc/xstartup

#! /Bin/sh

# Uncomment the following two lines for normal desktop:

Unset SESSION_MANAGER # uncomment
Exec/etc/X11/xinit/xinitrc # uncomment

[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup

[-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
Xterm-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&
Twm &

Switch to zzhzl account

[Root @ localhost ~] # Su-zzhz

[Zzhz @ localhost ~] $ Vi/home/etl/. vnc/xstartup # modify the same as above.

5. Connect the client to the server

The port used by the VNC service is related to the desktop number. The VNC uses the TCP port starting from 5900. The corresponding relationship is as follows:
Desktop number is "1" ---- port number is 5901
Desktop number "2" ---- port number is 5902
Desktop number "3" ---- port number is 5903

 

 

6. configure the firewall

If you do not configure a firewall and use the VNC Viewer to connect to it, the following error occurs: "connect: Connection timed out (10060:

 

[Root @ localhost ~] # Iptables-I INPUT-p tcp -- dport 5901-j ACCEPT

[Root @ localhost ~] # Iptables-I INPUT-p tcp -- dport 5902-j ACCEPT

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.