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