다음 튜토리얼 칼럼에서는 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 서비스를 비활성화로 설정[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 중국어 웹사이트의 기타 관련 기사를 참조하세요!