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