Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[host] introduction of vnc and problems needing attention during installation

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Linux Vnc remote Desktop Server configuration tutorial http://www.aiezu.com/Article/Linux_Vnc_Server_conf.aspx implements remote Desktop sharing with VNC (supports Windows, Linux ...) http://easwy.com/blog/archives/linux-remote-desktop-by-vnc/# [principle] # #-VNC The full name is Virtual Network Computing, which uses the RFB (Remote FrameBuffer, remote frame buffer) protocol to remotely control another computer. Sending keyboard and mouse actions to a remote computer and sending the screen of the remote computer back to the local VNC technology has nothing to do with the platform. VNC Viewer and VNC Server can support almost all operating systems on different operating systems, VNC also supports Java, and can even access VNC Server through browsers that support Java

Multiple VNC clients can be distinguished by connecting to a VNC Server display number (display number) at the same time. Each vncserver service listens on three ports, which are:

5800+ display number: httpd listening port of VNC, which must be open if the VNC client is a non-vncviewer such as IE,Firefox. 5900+ display number: the real port where the VNC server communicates with the client, which must be unconditionally open. 6000+ display number: X listening port, optional.

First of all, you need to configure the VNC password, which is used when using the client to connect to the server. Note: the VNC password is saved in the user's home directory, and each user can set his or her own password. Therefore, please run the following command using your user name (try not to use root):

When starting VNC server, you need to specify a display parameter for server to understand display as a desktop, and each user can have his own desktop. In the system, display number cannot repeat the port of VNC server monitoring starts from 5801, display: 1 listener 5801 display: 2 listener 5802 And so on # # [/ etc/sysconfig/vncservers] # {#-display the number, the open port is controlled by VNCSERVERS and VNCSERVERARGS in / etc/sysconfig/vncservers file, respectively, the setting mode of VNCSERVERS is VNCSERVERS= "display number 1: user name 1 …" For example, VNCSERVERS= "1:root 2:aiezu" VNCSERVERARGS setting mode is VNCSERVERARGS [display number 1] = "Parameter one parameter value one parameter two parameter value two..." For example, VNCSERVERARGS [2] = "- geometry 800x600-nohttpd"

The detailed parameters of VNCSERVERARGS are:-geometry desktop resolution. By default, 1024x768 doesn't listen on HTTP port (58xx port);-nolisten tcp does not listen on X port (60xx port);-localhost only allows access from the local machine;-AlwaysShared allows only one vncviewer connection by default. This parameter allows multiple vncviewer;-SecurityTypes None logins to be connected at the same time without password authentication. # vi / etc/sysconfig/vncserver VNCSERVERS= "1:root 2:oracle" VNCSERVERARGS [1] = "- geometry 1024x768-nolisten tcp" VNCSERVERARGS [2] = "- geometry 1024x768-nolisten tcp" # # [set user login password / generate user profile] # {{# -set VNC user password: # XXX do not skip this step and put it later Otherwise, VNC Server will not be able to launch # su-ink# vncpasswd Password:Verify:# su-root # vncpasswd Password:Verify:# [start vncserver] #-# service vncserver start after running the above command A series of files are generated under the ".vnc" folder under the user root directory ($HOME), where passwd is the vnc user password file generated by vncpasswd. The command to start VNC server when xstartup is a script that starts a VNC client connection is: vncserver # vncserverNew 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1Starting applications specified in / root/.vnc/xstartupLog file is / root/.vnc/localhost.localdomain:1.log#

# [Custom xstartup] # #

Modify the ".vnc / xstartup" file the default window manager used by vncserver is twm to edit this file: .vnc / xstartups bind bind sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec / etc/X11/xinit/xinitrc [- x / etc/vnc/xstartup] & & exec / etc/vnc/xstartup [- r $HOME/.Xresources] & & xrdb $HOME/.Xresources xsetroot-solid grey vncconfig-iconic & # xterm-geometry 80x24+10+10-ls -title "$VNCDESKTOP Desktop" &-Yes or no # twm & # gnome-session &

Restart vncserver to make the configuration effective

#}

# [configure Firewall] #-must allow the relevant port of VNC (58xx state-state NEW 60xx) vi / etc/sysconfig/iptables-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 5900Rank 5903-j ACCEPT to allow other machines to access ports 5900 to 5903 of this machine. Display:1, display:2, display:3 users can connect to the local machine my is-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 5801 ACCEPT 6003-j ACCEPT installation vnc, to check the iptables settings, if there is no open access to the vnc port, it is impossible to connect, and the vnc client will prompt failed connection: the operation completed successfully! (0) such an error prompt! #-use vncviewer+putty.exe to connect through ssh secure channel under windows: open putty, click "Connection"-> "SSH"-> "Tunnels" in "Category" on the left, enter "5901" in the "Source Port" text box, enter "localhost:5901" in the "Destination" text box, click "Add" to add port forwarding. Then under "Category" on the left side of putty, click "Session" to enter the IP address of the server, click the "Open" button, enter the password to log in, successfully enable port forwarding, and then open vncviewer on this machine and enter "127.0.0.1 Session 5901" to successfully connect to remote port 5901 under Linux using vncviewer+ssh secure channel connection: similar to ④ Run the "ssh-L 5901:localhost:5901 vncserverhost" command under the linux vnc client shell to enter the username and password. That is, through the shh secure channel, you can forward the remote port 5901 to the local port 5901, and then run the "vncviewer 127.0.0.1 vncviewer 1" command under shell to connect to the remote VNC Server#.

# #-View the port number of the display number that VNC is running? Answer: execute "netstat-tlup | grep vnc" at the Linux command prompt, that is, you can view the port number. The last two digits of the port number will display the number. how to turn off the specified display number? Answer: vncserver-kill: number can turn off the specified display number and the corresponding port number when launching the X application through the VNC-connected graphical interface desktop: "Error: Can't open display:: 0.0" error? Answer: please use the "echo $DISPLAY" command to see if the "DISPLAY" environment variable is set to ": display number: 0", such as: ": 1:0". If not, this error will occur when starting the X application. At this point, you can set the correct DISPLAY through "export DISPLAY=:1:0". Another possibility is to switch over the user to start the X application, and the current user does not have permission to use the X window. Then return to the VNC-enabled user to run "xhost +" to allow other users to access the X window. # if the configuration is completed, you can enter numbers through the keyboard, but not characters. It is important to see if the settings of your client's input method are consistent with those of the server. Usually both ends should be in English!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report