• 技术文章 >运维 >CentOS

    CentOS7.6服务器如何部署VNC

    藏色散人藏色散人2021-01-26 17:01:29转载774

    下面由centos教程栏目给大家介绍CentOS7.6服务器部署VNC的方法,希望对需要的朋友有所帮助!

    CentOS7.6服务器部署VNC

    安装vnc服务器

    [root@localhost ~]# yum install tigervnc-server

    开启vnc

    [root@localhost ~]# vncserver 
    
    You will require a password to access your desktops.
    
    Password:				//输入密码
    Verify:					//重复密码
    Would you like to enter a view-only password (y/n)? n		//只可看的密码,一般选n
    A view-only password is not used
    xauth:  file /root/.Xauthority does not exist
    
    New 'localhost.VD:1 (root)' desktop is localhost.VD:1
    
    Creating default startup script /root/.vnc/xstartup
    Creating default config /root/.vnc/config
    Starting applications specified in /root/.vnc/xstartup
    Log file is /root/.vnc/localhost.VD:1.log

    开启远程端口

    [root@localhost ~]# vncserver :1
    
    New 'localhost.VD:1 (root)' desktop is localhost.VD:1
    
    Starting applications specified in /root/.vnc/xstartup
    Log file is /root/.vnc/localhost.VD:1.log

    查看服务器ip

    [root@localhost ~]# ifconfig | grep inet
            inet 10.10.41.43  netmask 255.255.252.0  broadcast 10.10.43.255
            inet6 2400:dd01:1001:1040:3b37:b445:ad5b:ad2f  prefixlen 64  scopeid 0x0<global>
            inet6 fe80::bdd8:8bd:8871:f736  prefixlen 64  scopeid 0x20<link>
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>

    关闭防火墙和selinux

    1. 关闭防火墙

    将firewalld服务设置为disable

    [root@localhost ~]# systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

    查看状态,成功关闭

    [root@localhost ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:firewalld(1)
    
    Apr 22 10:06:35 localhost.VD systemd[1]: Starting firewalld - dynamic firewall daemon...
    Apr 22 10:06:37 localhost.VD systemd[1]: Started firewalld - dynamic firewall daemon.
    Apr 22 15:31:38 localhost.VD systemd[1]: Stopping firewalld - dynamic firewall daemon...
    Apr 22 15:31:39 localhost.VD systemd[1]: Stopped firewalld - dynamic firewall daemon.

    2. 关闭selinux

    [root@localhost ~]# setenforce 0
    [root@localhost ~]# vim /etc/selinux/config 
    
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=disabled				//开启时显示为enforcing,将其改为disabled
    [root@localhost ~]# getenforce
    Permissive

    远程访问

    打开vnc-viewer,输入需要访问的ip和端口号即可进行访问,本文中使用的ip为:10.10.41.43::5901

    以上就是CentOS7.6服务器如何部署VNC的详细内容,更多请关注php中文网其它相关文章!

    声明:本文转载于:csdn,如有侵犯,请联系admin@php.cn删除
    专题推荐:CentOS7.6
    上一篇:CentOS /RHEL系统怎么更新安全补丁 下一篇:详解CentOS 7安装GNOME图形界面
    大前端线上培训班

    相关文章推荐

    • 关于centos7 /boot/分区处理• centos go语言环境怎么搭建• CentOS /RHEL系统怎么更新安全补丁• Centos下PHP5升级PHP7的方法

    全部评论我要评论

  • 取消发布评论发送
  • 1/1

    PHP中文网