Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

vncserver@.service.in 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # The vncserver service unit file
  2. #
  3. # Quick HowTo:
  4. # 1. Copy this file to /etc/systemd/system/vncserver@.service
  5. # 2. Switches for vncserver should be entered in ~/.vnc/config rather than
  6. # hard-coded into this unit file. See the vncserver(1) manpage.
  7. # 3. Replace <USER> with the desired user
  8. # ("runuser -l <USER> -c /usr/bin/vncserver %i")
  9. # 4. Run `systemctl daemon-reload`
  10. # 5. Run `systemctl enable vncserver@:<display>.service`
  11. #
  12. # DO NOT RUN THIS SERVICE if your local area network is
  13. # untrusted! For a secure way of using VNC, you should
  14. # limit connections to the local host and then tunnel from
  15. # the machine you want to view VNC on (host A) to the machine
  16. # whose VNC output you want to view (host B)
  17. #
  18. # [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
  19. #
  20. # this will open a connection on port 590N of your hostA to hostB's port 590M
  21. # (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
  22. # See the ssh man page for details on port forwarding)
  23. #
  24. # You can then point a VNC client on hostA at vncdisplay N of localhost and with
  25. # the help of ssh, you end up seeing what hostB makes available on port 590M
  26. #
  27. # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
  28. #
  29. # Use "-localhost" to prevent remote VNC clients connecting except when
  30. # doing so through a secure tunnel. See the "-via" option in the
  31. # `man vncviewer' manual page.
  32. [Unit]
  33. Description=Remote desktop service (VNC)
  34. After=syslog.target network.target
  35. [Service]
  36. Type=forking
  37. # Clean any existing files in /tmp/.X11-unix environment
  38. ExecStartPre=/bin/sh -c '@BIN_DIR@/vncserver -kill %i > /dev/null 2>&1 || :'
  39. ExecStart=/usr/sbin/runuser -l <USER> -c "@BIN_DIR@/vncserver %i"
  40. PIDFile=/home/<USER>/.vnc/%H%i.pid
  41. ExecStop=/bin/sh -c '@BIN_DIR@/vncserver -kill %i > /dev/null 2>&1 || :'
  42. [Install]
  43. WantedBy=multi-user.target