Page 1 of 1

ssh login is one and done?

Posted: Sun Jul 08, 2012 8:16 pm
by feffer
Let me be clear up front, my main distro is LMDE, but I have many OSs on several computers. I use ssh extensively to connect and control them. Mostly, I use RSA key-pairs and password-less login. I've been doing this for a few years and haven't had any issues for a long time. However, I just added a new OS, the latest Kubuntu, to an open partition. As I said, I mainly work in LMDE, but I like to keep an eye on kde, thus the Kubuntu.

After setting up the keys etc, I logged in to my server, and everything seemed fine. I did some work, logged out, but later tried to log in again. No go?? I got the not allowed message. I tried other terminal tabs, restarting the ssh server, even closing and reopening the terminal.

If I re-import the key, it seems to work...exactly once? I'm completely baffled? I don't think this is a kde issue, because I'm using key-pairs and not the kwallet or anything like that. I'm asking here, because I a lot of smart people hang out here and as I've said already LMDE is my main OS.

Any ideas, how to deal with this?

Re: ssh login is one and done?

Posted: Wed Jul 11, 2012 5:28 pm
by feffer
Mystery solved...I think. The issue is with Kubuntu's new way of handling networking, I believe. I installed Ubuntu 12.04 LTS on an open partition and got the same problem. SSH login to other machines was erratic. Sometimes OK, sometimes failed with "Connection refused" message. An ssh key-pair setup should always succeed or always fail (if something is wrong).

With the new LTS release 12.04 Ubuntu/Kubuntu uses a different way of handling DNS. On my network, I use a router with Tomato firmware to resolve my local machines with it's built in dns resolver. But now Ubuntu is setting up another dns resolver locally. I think the two were interfering. The solution was simple. Open /etc/NetworkManager/NetworkManager.conf and comment out the line, "dns=dnsmasq"

Code: Select all

#vi /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile
#dns=dnsmasq

no-auto-default="machine number",

[ifupdown]
managed=false
After doing this on the two installs, ssh login is successful every time -- knock on wood ;-)

Hope this helps someone else

Cheers,
feffer

Re: ssh login is one and done?

Posted: Wed Jul 11, 2012 5:38 pm
by Habitual
That's some pretty good detective work. 8) 8)

Props!