1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Add example systemd unit for sshd in Diffusion docs

Summary:
The docs don't specify how to make the second sshd daemon start on every reboot.

I've added a unit that I use in my setup to the docs.

Ref T15467

Test Plan: Check that the docs look alright.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15467

Differential Revision: https://we.phorge.it/D25497
This commit is contained in:
Kuba Orlik 2023-12-18 10:54:51 +01:00
parent be763d90ce
commit bd44ec833f

View file

@ -585,6 +585,32 @@ Very carefully, restart `sshd`. Verify that you can connect on the new port:
Now you can move the Phorge `sshd` to port 22, then adjust the value
for `diffusion.ssh-port` in your Phorge configuration.
You can set up and enable this systemd unit to start the second sshd
daemon on every reboot:
```
name=/etc/systemd/system/phorge-ssh.service,lang=ini
[Unit]
Description=Phorge sshd
Documentation=https://we.phorge.it/book/phorge/article/diffusion_hosting/#sshd-setup
After=network.target auditd.service
[Service]
ExecStartPre=/usr/sbin/sshd -t -f /path/to/config_file.edited
ExecStart=/usr/sbin/sshd -f /path/to/config_file.edited
ExecReload=/usr/sbin/sshd -t -f /path/to/config_file.edited
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
Alias=phorge-sshd.service
```
No Direct Pushes
================