My laptop is running KDE Neon with all the latest updates. I would like to use this to ssh to my work. I use a config file for this purpose on my desktop. I copied the config file over along with the rsa key files from my desktop to the laptop. AFAICT the laptop and desktop use the same settings but I am unable to connect from the laptop. It gives me the following error:
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
My config file has the following:
Host blah
HostName blah.com
User kayvee
PasswordAuthentication yes
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
ControlMaster auto
ControlPath /tmp/ssh-blah
LocalForward 33333 workcomp:22
Match user kayvee !originalhost blah
ProxyCommand ssh -q blah -W %h:%p
Host workcomp
HostName localhost
Port 33333
User kayvee
IdentityFile ~/.ssh/blah_identity
AddKeysToAgent yes
PreferredAuthentications publickey,password
PasswordAuthentication yes
KbdInteractiveAuthentication yes
Since the exact same config works fine from my desktop, I am inclined to believe that I may have changed some of the network settings on my laptop that are causing this to happen. Is there a way to reset all network settings to defaults? Short of just reinstalling Neon, what are my options?
I checked the permissions of my .ssh/config and all of the rsa key files. They are at least readable by everyone and writable by me.
I typically connect as follows:
ssh -Nf blah
ssh workcomp
The first command succeeds without any issues. It asks me for a verification code from my authenticator app followed by password and then connects to the server.
It is only when I execute the next command to ssh to workcomp that I see the kex_exchange_identification error.
I finally gave up and reinstalled KDE Neon on my laptop.
Before doing so, I booted into the live image and ssh’d to my work machine. without any issues. However, after reinstalling I get the exact same error when I try to log in. Even now, when I use the live image, I am able to ssh to my workcomp but not from an installed copy.
This is strange.
I figured out what the issue is!
I have the same username for the remote machine I am logging to and local machine I am logging from. If I create a new user with a different username, I am able to use the exact same config file and login to the remote machine.
For now I have a workaround. I am just going to use a different username. Eventually, I need to figure out how to make this work with the same username on both remote and local machines.