The instructions tell the user to generate the id-rsa in root's .ssh but then the daemon is made without the proper permissions. We need to ether make it so that all the keygen stuff is happening on the local user or the systemmd deamon is made so that it has permission to grab that key. In this case I just rooted the daemon

Hunter Chasens 2019-02-13 18:45:43 -05:00
parent 4386693984
commit f6d24c0691

@ -2,6 +2,8 @@ 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.
There are two popular Service Managers for Unix-Like systems, OpenRC (BSD systems) and systemd (Linux). Eather one must be set up to run ssh-chat as a service (in the background). ssh-chat can be run as a user (not a daemon) but will stop servicing once the running user exits the terminal instance.
## OpenRC
`/etc/init.d/openrc`:
@ -53,7 +55,10 @@ After=network.target
[Service]
Type=simple
User=nobody
User=root
#You can store keys ouside of root and comment out 'User=root' then uncomment 'User=nobody'
#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
@ -62,14 +67,16 @@ Restart=always
WantedBy=multi-user.target
```
Make sure all your paths are readable by the user you're running as. If it's `User=nobody`, then they need to be readable by everyone. It's best to make a separate user just for your ssh-chat service and use that.
Make sure all your paths are readable by the user you're running as. If it's `User=nobody`, then they need to be readable by everyone!
It's best to make a separate user just for your ssh-chat service and store all files on this user.
# Installation Steps:
The following installation steps can be used to automate the installation on Ubuntu Linux 16 (LTS), some slight modifications may be required for other distributions.
The following installation steps can be used to automate the installation on Ubuntu Linux 16 (LTS), some slight modifications may be required for other distributions.
```bash
$ wget https://github.com/shazow/ssh-chat/releases/download/v1.6/ssh-chat-linux_amd64.tgz
$ wget https://github.com/shazow/ssh-chat/releases/download/v1.7/ssh-chat-linux_amd64.tgz
$ sudo tar -xf ssh-chat-linux_amd64.tgz -C /opt # extracts ssh-chat to /opt
$ sudo ln -sf /opt/ssh-chat/ssh-chat /usr/local/bin/ssh-chat # creates a symlink in /usr/local/bin for convenience
$ sudo ssh-keygen -t rsa -N '' -f /root/.ssh/id_rsa # generates a key/fingerprint for your server