How-To-Secure-A-Linux-Server
How-To-Secure-A-Linux-Server copied to clipboard
SSH listenaddress bug note
In some systems this bug will occur: sshd will not start at boot if ListenAddress is set. I ran into it myself following this guide. It is a failure of systemd and ssh devs to communicate who will fix it.
Anyway, there is a simple workaround to it by 'nimishp12':
changing /etc/systemd/system/sshd.service:
After=network.target audit.target
Wants=network.target
to
Requires=multi-user.target
Before=shutdown.target
After=multi-user.target
Wants=multi-user.target
This also solves the problem of using various network.service/targets that may still cause issues just using Before/After network-online.target
Does this work for you? It doesn't work for me.
Did you end up having the listenaddress issue too?
Yes, the lines I posted work for me, but in that bug report, I think there are 3 different methods to try (like the network-online.target
Before/after). I am really not sure why different ones are working for different people. Perhaps it is just the service start order?
Yes, I had issues. I will keep playing with it.