openspace42/raptor

Installing breaks ssh config

xiano8494 opened this issue · 3 comments

Once the installer had configured the cron job is going on to modify the ssh config. The installer crashed after trying to restart ssh:

Apr 04 09:50:19 shost7 systemd[1]: Starting OpenBSD Secure Shell server...
Apr 04 09:50:19 shost7 sshd[22013]: /etc/ssh/sshd_config line 88: garbage at end of line; "Match".
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Apr 04 09:50:19 shost7 systemd[1]: Failed to start OpenBSD Secure Shell server.
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Unit entered failed state.
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Failed with result 'exit-code'.

Adding a line break on line 88 fixed the problem.

Original:
UsePAM yes Match Group sftp_access
ChrootDirectory /home/%u
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

After adding line break:
UsePAM yes
Match Group sftp_access
ChrootDirectory /home/%u
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Good point. Not sure why it always worked for me, maybe because I was always using nano to edit the ssh config file prior to installing raptor, and nano always adds a blank line at the end?

Anyway, should be fixed in 4a02ecd

Please try removing all lines after UsePAM yes [not using nano perhaps] and re-run the installer with bash raptor/setup -be and see if it works for you.

Thanks

I tried on a different server, your fix has resolved the issue.

Great, thanks for testing it out.