Get the App
SLTechnology News&Howtos  ›  Network Security  › 

How to use vnc

Shulou Source: shulou.com Published: 2022-06-01 06:50:40 10月03日 Update

At work, the pure command line interface can be connected using xshell, but sometimes it is necessary to connect to the graphical interface, so it is necessary to use vnc or xmanager to realize the graphical interface of connecting centos remotely.

Note: the premise for using vnc is that the server must have a graphical interface installed, otherwise vnc cannot be used.

This case takes centos6.5 as an example.

1. First install the tigervnc-server service on the server side

# yum install tigervnc-server-y

two。 Modify the VNCServer main configuration file

# vim / etc/sysconfig/vncservers

Copy the last two lines and remove the first line commentator, and then modify it to

VNCSERVERS= "1:root"

VNCSERVERARGS [1] = "- geometry 1024x768"

3. Set the vnc remote connection password

# vncpasswd

Just enter the same password twice.

4. Start the vncserver service

# / etc/init.d/vncserver start

The default port is: 5901

5. When the previous step is completed, a hidden directory starting with .vnc is generated under the root host directory, and the files under this directory are the root user's VNC desktop configuration files. Open xstartup configuration Desktop

# vim / root/.vnc/xstartup

Change the last line to: gnome &

Because: my desktop is installed with a gnome desktop

6. If iptables is enabled, the relevant port needs to be released.

7. Connect with vnc client

a. Open vnc, select file in the upper left corner, and select "New connection"

The b.VNC Server line writes the IP and port to be connected; note: be sure to bring the port.

C.Name is to write the name or function of this host.

d. Click "OK", return to the VNC interface, and double-click to connect.

Tags: Interface desktop port service graphics file directory configuration password server selection same one line host function premise name command client client Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia vpn Docker Xiaomi