TigerVNC
TigerVNC
(타이거 가상 네트워크 컴퓨팅)는 당신이 다른 컴퓨터를 원격으로 제어하도록 허용하는 것을 공유하는 그래픽 데스크탑을 위한 시스템입니다.
TigerVNC`는 클라이언트-서버 네트워크에서 동작합니다: server*는 이 출력 (`vncserver
)과 *client (vncviewer
) 연결을 서버로 공유합니다.
페도라 15와 Red Hat Enterprise 리눅스 6에서와 달리, Fedora에서 |
VNC 서버
`vncserver`는 VNC (가상 네트워크 컴퓨팅) 데스크탑을 시작하는 유틸리티입니다. 이는 VNC 데스크탑에서 적절한 옵션과 함께 [application]*Xvnc를 실행하고 창 관리자를 시작합니다. `vncserver`는 사용자가 어디에서나 클라이언트 수에 의해 접근 되도록 할 수 있도록 장비에서 병렬로 분리된 세션을 실행하도록 허용합니다.
VNC 서버 구성
-
/etc/systemd/system/vncserver@.service`로 불리는 구성 파일이 필요합니다. 이와 같은 파일을 생성하려면, `root`으로 `/lib/systemd/system/vncserver@.service
파일을 복사합니다:~]#
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
파일 이름에 표시 번호가 포함될 필요가 없으며, 왜냐하면 `systemd`는 자동으로 요청 시에 메모리에 적절한 이름의 인스턴스를 생성하고, 서비스 파일의 ’%i'`를 표시 번호에 의해 대체하기 때문입니다. 단일 사용자의 위해서 파일 이름을 변경 할 필요가 없습니다. 다중 사용자의 경우, 예를 들면 어떤 방식에서 사용자 이름을 파일 이름으로 추가하여 각 사용자를 위해 고유한 named 서비스 파일이 필요합니다.자세히 알기 위해 두 명의 사용자를 위해 VNC 구성하기를 참고하세요.
-
실제 사용자 이름과 함께 _USER_를 교체하는`/etc/systemd/system/vncserver@.service`를 편집합니다. 파일의 잔여 줄은 수정하지 않은 상태로 놔둡니다.
-geometry
인수는 생성되도록 하는 VNC 데스크탑의 크기를 지정합니다; 기본값으로, 이는 `1024x768`로 설정합니다.ExecStart=/sbin/runuser -l USER -c "/usr/bin/vncserver %i -geometry 1280x1024" PIDFile=/home/USER/.vnc/%H%i.pid
-
변경을 저장합니다.
-
변경 사항을 즉시 적용하려면, 다음 명령을 실행하세요:
#
systemctl daemon-reload
-
사용자 또는 구성 파일에서 정의된 사용자를 위해 비밀번호를 설정합니다. 당신은 `root`에서 _사용자_우선으로 전환이 필요하다는 것을 참고하세요.
# su - USER $
vncpasswd
비밀번호: 확인:저장된 비밀번호는 암호화 되지 않습니다; 비밀번호 파일에 접근하고자 하는 누구도 일반-텍스트 비밀번호를 찾을 수 있습니다.
VNC 서버 시작하기로 진행.
Configuring VNC Server for Two Users
If you want to configure more than one user on the same machine, create different template-type service files, one for each user.
-
Create two service files, for example
vncserver-USER_1@.service
andvncserver-USER_2@.service
. In both these files substitute USER with the correct user name. -
두 사용자 모두를 위한 비밀번호 설정:
$ su - USER_1 $ vncpasswd 비밀번호: 확인: $ su - USER_2 $ vncpasswd 비밀번호: 확인:
VNC 서버 시작하기
서비스를 시작하거나 활성화 하려면, 명령에서 직접 표시 번호를 지정하세요. 위에 구성된 우선 VNC 연결 구성하기 파일은 `%i`가 `systemd`에 의해 표시 번호로 대체되는 템플릿트로 동작합니다. 유효한 표시 번호와 함께, 다음 명령을 실행합니다:
# systemctl start vncserver@:display_number.service
당신은 또한 시스템 시작시에 자동으로 시작하려는 서비스를 활성화 할 수 있습니다. 그런 후, 로그인 할 때에 `vncserver`는 자동으로 시작됩니다. `root`으로, 다음과 같은 명령어를 입력하세요:
# systemctl enable vncserver@:display_number.service
이 점에서, 다른 사용자는 VNC 표시기 프로그램을 정의된 표시번호와 비밀번호를 사용하여 VNC 서버로 연결하는데 사용 할 수 있습니다. 제공된 그래픽 데스크탑이 설치되었고, 데스크탑의 예가 표시됩니다. 대상 장비에서 현재 표시되는 것과 같은 동일한 경우는 아닙니다.
Configuring VNC Server for Two Users and Two Different Displays
두 개로 구성된 VNC 서버를 위해, , vncserver-USER_1@.service 및 vncserver-USER_2@.service, 당신은 다른 화면 번호를 사용 할 수 있습니다. 예제로, 다음 명령은 화면 3에서 시작하려는 _USER_1을 위한 VNC 서버, 그리고 화면 5에서 시작하는 USER_2를 위한 VNC 서버를 발생합니다:
# systemctl start vncserver-USER_1@:3.service # systemctl start vncserver-USER_2@:5.service
VNC 표시기
`vncviewer`는 공유된 그래픽 사용자 연결장치를 표시하고 서버를 제어하는 프로그램입니다.
For operating the vncviewer
, there is a pop-up menu containing entries which perform various actions such as switching in and out of full-screen mode or quitting the viewer. Alternatively, you can operate vncviewer
through the terminal. Enter vncviewer -h on the command line to list vncviewer
's parameters.
Installing VNC Viewer
To install the TigerVNC client, vncviewer>, issue the following command as root
:
# dnf install tigervnc
Connecting to VNC Server
Once the VNC server is configured, you can connect to it from any VNC viewer. In order to do so, issue the vncviewer command in the following format:
vncviewer address:port_number
Where address is an IP
or host name.
With the IP
address 192.168.0.4
and display number 3 the command looks as follows:
$ vncviewer 192.168.0.4:3
Configuring the Firewall for VNC
When using a non-encrypted connection, firewalld
might block the connection. To allow firewalld
to pass the VNC packets, you can open specific ports to TCP
traffic. When using the -via
option, traffic is redirected over SSH
which is enabled by default in firewalld
.
The default port of VNC server is 5900. To reach the port through which a remote desktop will be accessible, sum the default port and the user’s assigned display number. For example, for the second port: 2 + 5900 = 5902. |
For displays 0
to 3
, make use of firewalld
's support for the VNC service by means of the service
option as described below. Note that for display numbers greater than 3
, the corresponding ports will have to be opened specifically as explained in Opening Ports in firewalld.
-
Run the following command to see the information concerning
firewalld
settings:$ firewall-cmd --list-all
-
To allow all VNC connections from a specific address, use a command as follows:
# firewall-cmd --add-rich-rule='rule family="ipv4" source address="192.168.122.116" service name=vnc-server accept' success
See the Red Hat Enterprise Linux 7 Security Guide for more information on the use of firewall rich language commands.
-
To verify the above settings, use a command as follows:
# firewall-cmd --list-all public (default, active) interfaces: bond0 bond0.192 sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules: rule family="ipv4" source address="192.168.122.116" service name="vnc-server" accept
To open a specific port or range of ports make use of the --add-port
option to the firewall-cmd command Line tool. For example, VNC display 4
requires port 5904
to be opened for TCP
traffic.
-
To open a port for
TCP
traffic in the public zone, issue a command asroot
as follows:# firewall-cmd --zone=public --add-port=5904/tcp success
-
To view the ports that are currently open for the public zone, issue a command as follows:
# firewall-cmd --zone=public --list-ports 5904/tcp
A port can be removed using the firewall-cmd --zone=zone --remove-port=number/protocol command.
For more information on opening and closing ports in firewalld
, see the Red Hat Enterprise Linux 7 Security Guide.
Connecting to VNC Server Using SSH
VNC is a clear text network protocol with no security against possible attacks on the communication. To make the communication secure, you can encrypt your server-client connection by using the -via
option. This will create an SSH
tunnel between the VNC server and the client.
The format of the command to encrypt a VNC server-client connection is as follows:
$ vncviewer -via user@host:display_number
-
To connect to a VNC server using
SSH
, enter a command as follows:$ vncviewer -via USER_2@192.168.2.101:3
-
When you are prompted to, type the password, and confirm by pressing Enter.
-
A window with a remote desktop appears on your screen.
If you prefer only encrypted connections, you can prevent unencrypted connections altogether by using the -localhost
option in the systemd.service
file, the ExecStart line:
ExecStart=/sbin/runuser -l user -c "/usr/bin/vncserver -localhost %i"
This will stop vncserver
from accepting connections from anything but the local host and port-forwarded connections sent using SSH
as a result of the -via
option.
For more information on using SSH
, see OpenSSH.
Want to help? Learn how to contribute to Fedora Docs ›