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