Comment 2 for bug 1834128

Revision history for this message
Luke A. Perkins (public-a) wrote :

The way I created this was to implement 2 sshd services called wan_sshd and lan_sshd. I used the existing sshd.service files as templates. See attached files. This solution reliably works using Ubuntu 18.04.2 LTS with OpenSSH 7.6p1.

Addition things I had to do:

1) Delete the sshd.service, sshd.socket, and sshd@.service in the /lib/systemd/system directory.
2) Perform a "sudo systemctl disable ssh". All this does is delete the links to the files in step #1.
3) Delete the /etc/rc*.d/S01ssh files.
4) Delete the /etc/init.d/ssh
5) Replace the /etc/default/ssh with the ssh.default in the ZIP file.
6) Delete the /etc/ssh/sshd_config. Add the sshd_*_config files from the ZIP file.
7) Add the wan_sshd* and lan_sshd* files to the /lib/systemd/system directory from the ZIP file. NOTE: Files called _at.service should be renamed to @.service.
8) Generate your own key files and make appropriate changes to the sshd_*_config files.
9) Add the usr_lib_tmpfiles_d.conf from the ZIP file as /usr/lib/tmpfiles.d/sshd.conf
10) Reboot the machine and make sure /run/sshd exists BEFORE enabling the 2 services.

I make the assumption that the reader has the skill set to use systemctl to get the services started. I also assume the reader has the skill set to edit a shsd_*_config file.