VNC (Virtual Network Console),即 虚拟网络控制台。它是一款优秀的远程控制工具软件,而且是基于 UNIX 和 Linux 操作系统的免费开源的。
rpm -qa | grep vnc
yum install tigervnc tigervnc-server -y
vim /etc/sysconfig/vncservers
https://img-blog.csdnimg.cn/20181211183537467.png
配置说明:
- 1、VNCSERVERS 配置登录远程桌面的用户名;
- 2、VNC 的默认监听端口是 5900,监听端口规则为590+usernumber【如 2:root对应端口号5902】
- 3、VNCSERVERARGS[2] 登录桌面配置;【2 为用户序号,1366x768 为分辨率,-nolisten tcp 为阻止tcp包,-nohttpd 为阻止http包,-localhost 代表只监听本地。如:VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"】
vncpasswd
/etc/init.d/vncserver start
或
service vncserver start
或重启
service vncserver restart
vim /root/.vnc/xstartup
https://img-blog.csdnimg.cn/20181211190638248.png
注意: 如果没有安装 Linux 图形界面,则需要安装:
rpm -qa |grep gnome 【检查是否安装了图形界面】
yum groupinstall "X Window System" "Chinese Support" "Desktop" 【安装】
iptables -I INPUT -p tcp --dport 5902 -j ACCEPT
chkconfig vncserver on
原文:https://www.cnblogs.com/zhangliuhero/p/13804382.html