RedHat7 配置VNCServer
发布时间:2020-02-28 19:33:03
来源:51CTO
阅读:1343
作者:孙洪波
1. 安装软件(使用root账号)
# yum install tigervnc-server
2. 配置VNC用户密码
[root@localhost ~]# su - michael
Last login: Wed Jan 9 13:52:12 CST 2019 on pts/2
[michael@localhost ~]$ vncpasswd
Password:
Verify:
3. 配置并启动VNC Service
按照/lib/systemd/system/vncserver@.service中的:
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:1.service
# 2. Edit /etc/systemd/system/vncserver@.service, replacing
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l -c "/usr/bin/vncserver %i"
# PIDFile=/home//.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:.service`
4. 配置防火墙(注意每个使用的端口都要配置)#
iptables -I INPUT -m state --state NEW -p tcp --destination-port 5901 -j
ACCEPT
#
iptables -I INPUT -m state --state NEW -p tcp --destination-port 5902 -j
ACCEPT
#
service iptables save
5. 完成,现在应该可以通过客户端连接了。