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