418d68
# The vncserver service unit file
418d68
#
418d68
# Quick HowTo:
418d68
# 1. Copy this file to /etc/systemd/system/xvnc@.service
418d68
# 2. Copy xvnc.socket to /etc/systemd/system/xvnc.socket
418d68
# 3. Run `systemctl daemon-reload`
418d68
# 4. Run `systemctl enable xvnc.socket`
418d68
#
418d68
# DO NOT RUN THIS SERVICE if your local area network is
418d68
# untrusted!  For a secure way of using VNC, you should
418d68
# limit connections to the local host and then tunnel from
418d68
# the machine you want to view VNC on (host A) to the machine
418d68
# whose VNC output you want to view (host B)
418d68
#
418d68
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
418d68
#
418d68
# this will open a connection on port 590N of your hostA to hostB's port 590M
418d68
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
418d68
# See the ssh man page for details on port forwarding)
418d68
#
418d68
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
418d68
# the help of ssh, you end up seeing what hostB makes available on port 590M
418d68
#
418d68
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
418d68
#
418d68
# Use "-localhost" to prevent remote VNC clients connecting except when
418d68
# doing so through a secure tunnel.  See the "-via" option in the
418d68
# `man vncviewer' manual page.
418d68
418d68
418d68
[Unit]
418d68
Description=XVNC Per-Connection Daemon
418d68
418d68
[Service]
418d68
ExecStart=-/usr/bin/Xvnc -inetd -query localhost -geometry 1024x768 -depth 24 -once -SecurityTypes=None
418d68
User=nobody
418d68
StandardInput=socket
418d68
StandardError=syslog