11

I'm using a script that connects to a cluster through ssh and sends some commands, then quits the connection. This script basically connects once using ssh, then executes a script in this session. This script loops through a list of commands a few times and after it is finished, the connection is terminated.

So this script works fine, except for the fact that after a few loops it gives me the following error at loop 22. And then again at loop 32. The loops do exactly the same thing, so I cannot grasp the problem the script is facing. I don't think it is possible for this script to ask for authentication each time he has to run through a loop.

This is the error:

key_read: uudecode AAAAB3NzaC1yc2EAAAABIwAAAQEAxmNx2hcXLpTjuaa3yKC3B9gbF7KprP2/
CH8fBgMbCyIcOB+ZMQDmEnbVTqedBwV/mxjZzorEpHTM8MX2WsTjFsxwzDgcpuxm+3cwfb0WSy9Y4Kb
F8crAsRDbBIpUZ2n/iSdRcds9nTjk6PA61kTS24RLACHpqF18vudlO5WcbCOnAwa+DdUs0Raw29UiQc
BaC6M4YPnApq9Ayy7a6qFI2uK6efkwfLTZIDivWlIdLpRLEyuBEpozQQhEd0mrGhR/
Gl1GevRvFMms14130xQ4A5UpJSn6CmrRIWBkcgp1TilqDGQ1F5xZOinnc4C00gFrbT3hkkQqY5A9p
node023,10.141.0.31 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxmNx2hcXLpTjuaa3yKC3
B9gbF7KprP2/CH8fBgMbCyIcOB+ZMQDmEnbVTqedBwV/mxjZzorEpHTM8MX2WsTjFsxwzDgcpuxm+
3cwfb0WSy9Y4KbF8crAsRDbBIpUZ2n/iSdRcds9nTjk6PA61kTS24RLACHpqF18vudlO5WcbCOnAw
a+DdUs0Raw29UiQcBaC6M4YPnApq9Ayy7a6qFI2uK6efkwfLTZIDivWlIdLpRLEyuBEpozQQhEd0m
rGhR/Gl1GevRvFMms14130xQ4A5UpJSn6CmrRIWBkcgp1TilqDGQ1F5xZOinnc4C00gFrbT3hkkQqY5
A9pa0lQHFkSw==

7 Answers 7

15

Another reason why this problem can happen:

I had a similar issue while SSHing to one of our servers: it would work but display this strange error message. The solution was actually to fix the ~/.ssh/known_hosts which had 2 entries for this server.

Sign up to request clarification or add additional context in comments.

1 Comment

By "fix" you mean remove one of the two entries, right?
4

I pasted my id_rsa.pub contents from Windows into a Linux VM. That caused CRLFs to be inserted in the middle of the lines in a few places, that were only obvious if I edited the file with a wide enough window (or cat'd in a wide enough terminal). Removing the CRLFs so the entire thing was on one line fixed this issue.

Comments

3

You may be dealing with some time out issues... try adding a sleep into the script to make the loops take longer and see if it still dies on loop 22 and 32... it may just be the timing of when those loops happen. If this is the case you may have to either make adjustments to the sshd configure file on the server you're logging into (if you have access) otherwise you can always add to the ssh configuration on the local computer. Something like "ServerAliveInterval 5" may help.

3 Comments

Thnx for your help in this situation, it's a big script so i'll let you know when it finishes.
The "ServerAliveInterval 5" didnt do anything for me, but sleep seems to work, i'm gonna try it out on my other batches as well, thnx!
Well, the sleep wasn't designed to "Fix" anything... merely tell you if there was something special about the number 22 and 32 or if "it always breaks 55 minutes into the process and 80 minutes in" (assuming each cycle takes 2.5 minutes) or something like that. Sorry to say, it sounds like you're problem isn't solved and will probably continue to strike randomly, we've just shown it is unreliable (though there is a small chance the sleep fixed it, hopefully that is the case).
3

For me it was a error in the ~.ssh/known_hosts file in my .ssh folder. I deleted all lines to get a "fresh" start of known hosts, and I got no errors after this.

1 Comment

This worked for me, deleting only the line(s) for to the host I was logging into fixed the problem. I suspect it is related to the host's key changing.
2

Hopefully this might help a few people.

I had this exact error message when SSHing to any server. The interesting thing was that I was allowed access still. I checked all the SSH key files and they where all on a single line (which a lot of people reported as a possible cause).

Then I removed the comment from the RSA public (== [email protected]) and it worked! I then removed that line from the DSA public; the error popped up again.

I'm not that knowledgable on SSH keys and how they work exactly, but this seems to have done the trick for a number of servers I access. So remove the comment from RSA public and leave it in for the DSA public.

Comments

0

I saw this online: http://support.bb4.com/archive/200408/msg00235.html

Looked similar to your problem. There is another link in the post to more detailed info on Big Brother's website.

1 Comment

I've been reading some topics regarding this problem, including yours, but none of them really are a solution to mine.
0

For me, I had a public key for one server spread over multiple lines due to copypasta. Putting the entire key onto a single line resolved this error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.