From f6026c2e7040cc5e1182f67750432713dadc920a Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Thu, 15 Feb 2018 12:43:24 -0500 Subject: [PATCH] Add systemd service --- Deployment.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Deployment.md b/Deployment.md index d644f62..0606ed2 100644 --- a/Deployment.md +++ b/Deployment.md @@ -1,4 +1,6 @@ -This page documents how to deploy ssh-chat using various methods +This page documents how to deploy ssh-chat using various methods. + +You can run ssh-chat on port 22, but then you'll need to change the port of OpenSSH to something else like 2022. You can do this in `/etc/ssh/sshd_config`. Two services can't run on the same port like this. ## OpenRC @@ -40,4 +42,26 @@ This page documents how to deploy ssh-chat using various methods # systemd +(Replace `/PATH/TO/`) + +`/etc/systemd/system/ssh-chat.service`: + +``` +[Unit] +Description=ssh-chat +After=network.target + +[Service] +Type=simple +User=nobody +ExecStart=/PATH/TO/ssh-chat --bind=":22" -i="/PATH/TO/host_key" --admin="/PATH/TO/authorized_keys" +AmbientCapabilities=CAP_NET_BIND_SERVICE +Restart=always + +[Install] +WantedBy=multi-user.target +``` + +Additional resources: + - https://impactcore.blogspot.ca/2017/09/ssh-chat-irc-like-chat-client-over-ssh.html