(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-2
to 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?)
.local
likeHost server_user.local
, since all my shell functions expect it.) I don't think I can count this as the actual answer, though, since I still have no idea what caused the problem or how to fix that root cause. I mean, it worked perfectly since I installed the ubuntu and set up ssh (about 5 days ago), and then suddenly (again, literally just got tea and came back) ... poof? As far as I can remember, I didn't install/upgrade/change anything in the system. (And/var/log/apt/history.log
agrees, if I understand it right.) – Owen_AR Mar 28 '21 at 06:58ps -eo cmd|grep avahi
, and found (besidesavahi-daemon: chroot helper
) this:avahi-daemon: running [ubuntu_comp_hostname-2.local]
. (Andssh ubuntu_comp_hostname-2.local
works as expected.) 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-2
to the end of the actual hostname? Sound like I'm on the right track? – Owen_AR Mar 30 '21 at 04:39sudo service avahi-daemon restart
worked (no more-2
, and I removed the~/.ssh/config
files from both computers (didn't have any before), and everything connects by hostname.local as expected again.) 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?) – Owen_AR Mar 30 '21 at 04:57