Centos7安装配置vnc

前提条件,已经安装了一个图形界面

yum install tigervnc-server -y ==>安装vnc服务

systemctl status vncserver@:.service ==>检查服务状态

vncserver@:.service - Remote desktop service (VNC)

   Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; disabled)

   Active: inactive (dead)

systemctl is-enabled vncserver@.service ==>检查是服务是否开机启动

disabled

ll /lib/systemd/system/vncserver@.service ==>查看文件

-rw-r--r--. 1 root root 1738 Nov 21 04:53 /lib/systemd/system/vncserver@.service

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service==>复制

useradd vncuser==>创建远程vnc用户

echo 密码|passwd --stdin vncuser==>创建密码

sed -i 's/<USER>/vncuser/g' /etc/systemd/system/vncserver@:1.service==>修改用户

su - vncuser

Last login: Sun Feb 28 12:54:31 CST 2016 on pts/0

[vncuser@localhost ~]$ vncserver或vncpassd  ==>创建远程登录密码


You will require a password to access your desktops.


Password:                最低6位

Verify:

su

systemctl daemon-reload

systemctl start vncserver@:1==>启动服务

systemctl status vncserver@:1

vncserver@:1.service - Remote desktop service (VNC)

   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; disabled)

   Active: active (running) since Sun 2016-02-28 13:35:37 CST; 5min ago

  Process: 1670 ExecStart=/usr/sbin/runuser -l vncuser -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)

  Process: 1668 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

 Main PID: 1696 (Xvnc)

   CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service

           鈥1696 /usr/bin/Xvnc :1 -desktop localhost:1 (vncuser) -auth /home...


Feb 28 13:35:34 localhost systemd[1]: Starting Remote desktop service (VNC)...

Feb 28 13:35:37 localhost systemd[1]: Started Remote desktop service (VNC).

firewall-cmd --permanent --add-service vnc-server==>打开端口

systemctl restart firewalld==>重启防火墙

windows下打开vncview ip:1测试




     本文转自whshurk 51CTO博客,原文链接:http://blog.51cto.com/shurk/1745743,如需转载请自行联系原作者




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值