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