(see EDIT added to end, bout avahi stuff)
It just does this:
> ssh -v [ubuntu_comp_hostname].local =>
OpenSSH_8.2p1, LibreSSL 3.0.2
debug1: Reading configuration data /home/o1/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
ssh: Could not resolve hostname [ubuntu_comp_hostname].local: Name or service not known
(Like, this didn't even start after rebooting or waking one of the computers from sleep or anything. It was working, I got up for a few minutes to get some tea, came back, and it was suddenly no longer working.)
I can still ssh in by using the IP of the ubuntu computer
(
ie, in place of [ubuntu_comp_hostname].local)
-- it's the IP I get by running this command:
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
(I copied it from somewhere I forget and have had it hanging around in an alias for a while)
)
I can still ssh in to the other computer from the ubuntu computer, by using the hostname of the other computer.
And very confusingly to me,
I'm running a synergy client on the ubuntu computer,
and the client and server connect by using the two computers' hostnames,
and that still works just fine
(I just killed and restarted synergy on both computers to check, and yup, it reconnected just fine.)
I have no clue: where do I start on trying to debug this?
EDIT (copied up from my comments below):
I just tried ps -eo cmd|grep avahi, and found (besides avahi-daemon: chroot helper)
this:
avahi-daemon: running [ubuntu_comp_hostname-2.local].
(ie, there's this extra -2 there on the end of the hostname for no apparent reason).
((Trying to connect with ssh ubuntu_comp_hostname-2.local does work.))
I'm extremely ignorant on all this stuff, but I'm guessing that...
avahi crashed or restarted or something?
And then it tried to run as plain
[ubuntu_comp_hostname.local],
but that was still hanging around in a defunct state or something,
so it automatically appended a-2to the end of the actual hostname?
And yeah, sudo service avahi-daemon restart worked
-- ie, there's no more -2,
and everything connects by hostname.local as expected again
(even though I removed the ~/.ssh/config file with I added as a workaround as recommended (didn't have any such file before))
I'm still wondering what caused the problem in the first place, though,
and how to prevent it from happening again
(or at least get it to automatically fix itself?)