一、TightVNC 简介

TightVNC 官方网址: https://www.tightvnc.com/

1、什么是 TightVNC ?

TightVNC是免费的远程控制软件包。使用TightVNC,您可以 看到远程计算机的桌面并用本地鼠标和键盘对其进行控制,就像坐在该计算机的前面一样。

TightVNC是:

  • 免费提供个人和商业用途,并提供完整的源代码,
  • 在管理,技术支持,教育以及其他许多目的中很有用,
  • 跨平台,适用于Windows和Unix,并包含Java客户端,
  • 与标准VNC软件兼容,符合RFB协议规范。

使用TightVNC,您可以:

  • 减少开支,节省旅行时间,
  • 帮助您的朋友和家人远程解决计算机问题,
  • 确保当您不在时,您的计算机上没有发生任何错误。

本文以TightVNC为例描述如何图形化安装!

二、TightVNC 服务端

1、安装 X-Window

执行如下安装命令:

yum check-update
yum groupinstall -y "Desktop"
yum groupinstall -y "X Window System"
yum groupinstall -y "Chinese Support"
yum install -y gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
reboot #重启机器

2、安装 TightVNC 服务端

检出是否安装VNC

rpm -q tigervnc tigervnc-server

执行如下安装命令:

yum install -y tigervnc tigervnc-server

3、启动 TightVNC(root用户)


$ vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

New 'oracle11g:1 (root)' desktop is oracle11g:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oracle11g:1.log

4、TightVNC 开机启动

4.1、从VNC备份库中复制service文件到系统service服务管理目录下
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
4.2、修改 vncserver@:1.service 文件

修改配置文件 /etc/systemd/system/vncserver@:1.service

grep -n "^[^#]" /etc/systemd/system/vncserver@:1.service

修改脚本中的 <USER> 为指定Linux账号

vi /etc/systemd/system/vncserver@:1.service

mkdir /home/<USER>/.vnc

修改文件使配置生效:

systemctl daemon-reload
4.3、为 vncserver@:1.service 设置密码
$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
4.4、启动 TightVNC
systemctl enable vncserver@:1.service #设置开机启动
systemctl start vncserver@:1.service #启动vnc会话服务
systemctl status vncserver@:1.service #查看nvc会话服务状态
systemctl stop vncserver@:1.service #关闭nvc会话服务
netstat -lnt | grep 590* #查看端口

作者:Jeebiz  创建时间:2020-06-12 10:37
 更新时间:2024-08-20 17:39