首页 > 其他 > 详细

RHEL7.1配置VNC

时间:2016-06-29 11:14:13      阅读:150      评论:0      收藏:0      [点我收藏+]
1.安装包
yum install vnc* -y
2.创建密码
vncserver
3.创建参数文件
[root@single ~]# cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
4.修改参数文件
[root@single ~]# vi /lib/systemd/system/vncserver@\:1.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"                                    --------修改处1:以root用户为例,-l后修改为用户名
PIDFile=/root/.vnc/%H%i.pid                                                                                  --------修改处2:.vnc前设置用户的家目录,root为/root
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

如果使用其他用户登录,需要
vncpasswd user_name
5.启动
systemctl start vncserver@:1.service
6.如果想开机自启动,那么
systemctl enable vncserver@:1.service

注:如果你是第一次接触RHEL7,那么你此时肯定连接不上VNC,因为:
service iptables stop根本就关不掉防火墙!
需要:systemctl stop firewalld
禁止防火墙开机自启动:
[root@single ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'


RHEL7.1配置VNC

原文:http://blog.csdn.net/ghostliming/article/details/51775294

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!