centos7安装配置vnc和远程桌面,WIN10 mstsc远程linux gnome桌面

 红帽服务器(redhat)或者centos服务器 VNC配置过程

yum install -y tigervnc-server xrdp

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

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

修改<user>为 root(或其它用户)

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/home/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

 

systemctl daemon-reload

vncpasswd

vim /etc/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

firewall-cmd --permanent --add-service vnc-server

systemctl stop firewall.service

systemctl disable firewall.service

systemctl enabled vncserver

systemctl start vncserver

 

 

 

 


posted @ 2019-11-15 16:30  Tnu  阅读(447)  评论(0编辑  收藏  举报