Completely brand new to linux and Ubnuntu. Setting up a machine to do deep learning/neural networks. So far it is going well. Got everything installed and running. I want to be able to ssh from my Mac laptop to use the system. I installed openssh and got that working.
However when I restart the machine, the ssh server doesn't restart. I check with
sudo service ssh status and it reports and error. I can then start it and everything works fine.
My first thought was I need to tell it to start on reboot, and I found this thread which says that it should start by default and I don't need to add a chrontab or anything like that. So I don't think that is it.
Then I found this thread which suggest using the command
sudo update-rc.d ssh defaults, but that thread is quite old and it seems that answer was maybe not right even back then?
So then I found this thread which suggest commenting out the
ListenAddress line in the sshd_config file. Basically it says if the ListenAddress is used it may try to get the IP before it has been assigned by the DCHP and so start up fails. Which makes sense. But I need that parameter to make my port forwarding work over my home network.
This documentation under the entry for ListenAddress says that
The default is to listen on all local addresses.
So maybe I don't need it to make port forwarding work?
I followed the previous thread to this bug report which is also quite old, but suggests to use network manager to restart ssh every time netmanager gets a new IP.
echo /etc/init.d/ssh restart > /etc/NetworkManager/dispatcher.d/10ssh chmod 755 /etc/NetworkManager/dispatcher.d/10ssh
That is a lot more than this noobie can evaluate at this point. Is that safe? Is that the way to do this? Has something else been worked out in the last 7 years?
Any advice would be great. Thanks.