The VNC server is configured below to enable users (root) to connect remotely to the Linux system's graphical interface via VNC clients (provided your server installs the desktop)
1. Check to see if the Linux system has VNC installed
Rpm-q Vnc-server
"Package Vnc-server is not installed" shows that the VNC server was not installed
If you do not install VNC using the following command
Yum Install Vnc-server
2. Start VNC Service
Vncserver
You'll require a password to access yourdesktops.
Password:
Verify:
Prompts for the password, which is the password required for remote login, enter the password, return
4, switch to root account: Su root and then enter the password of the root account
Vim/etc/sysconfig/vncservers #vnc配置文件
Remove the following two lines of comments.
Vncservers= "1:root" # 1:root (Desktop number: User), configure startup desktop
vncserverargs[2]= "-geometry 1204x768-nolisten tcp-localhost"
800x600 represents the resolution of the desktop
Last Saved exit
5. Restart VNC server
Method One: Etc/init.d/vncserver restart
Method Two: Service Vncserver restart
6, set up VNC server automatically start
Vi/etc/rc.local
Add the following to the file
/etc/init.d/vncserverstart
7, change VNC connection password
vncpasswd
8. Connect Remote Desktop
Use SECURECRT to connect to the target machine.
Execute the iptables–f command,
You can then connect using the VNC viewer
After the remote Desktop is accepted, the reboot firewall will allow the remote VNC connection to be made.
Note: If a gray screen appears after the connection, you can set the following method
Enter User's home directory
Cd/home/user
If you are logged in with the root account, the current directory is the user's root directory.
CD ~/.vnc
VI Xstartup #编辑
#twm & #注释掉这一行
Gnome-session & #添加这一行