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