Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First time failure, second time partial success #6

Open
tremby opened this issue May 22, 2013 · 4 comments
Open

First time failure, second time partial success #6

tremby opened this issue May 22, 2013 · 4 comments

Comments

@tremby
Copy link

tremby commented May 22, 2013

After getting the script working and posting the findings in #5, I ran the script again on a different server (one I had never connected to, and so I had to accept the server key, if that makes a difference). I typed the password as requested and it exited with code 1 and no output again. I tried to log in with ssh and it prompted me for the password again. On logging in I inspected authorized_keys and saw that it had a bizarre line as follows (with my correct public key partially replaced with stars and a seemingly corrupt key (or is it the server's key? transmountain is part of the hostname) partially replaced with hashes):

ssh-rsa AAAAB3N#####7PHLTOun transmountain-rsa-key-1347299094ssh-rsa AAAAB3N*****7eqiY5 /Users/tremby/.ssh/id_rsa

I then logged out and ran the script again. This time it exited with code 1 again, but when I tried to ssh in to the server again, it worked. Now there is a second line in authorized_keys identical to the tail section of the above:

ssh-rsa AAAAB3N*****7eqiY5 /Users/tremby/.ssh/id_rsa

No idea what is happening here. If you request I could remove my keys and acceptance of the server's key and try again.

@beautifulcode
Copy link
Owner

I have not seen that before. If you could remove them and try again just to confirm? Thanks.

@tremby
Copy link
Author

tremby commented Jun 7, 2013

I guess there's no harm in showing my public key here. The line I see this time, on getting the same exact behaviour on a different server, is:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXOJLR6FHQ9ZelpY12814eozkXz/q5vBZ84Z22cuLdq++ZH6bvnXmL6bo5NaIlwNKEEO8sNTQM0yinDWRPKViS2SGETbE3uVfrq8v/yNoVlNdEGUctwYRYKmFJeSqcCh3g9rVqgOj8a9ilZhmNQz18SC2drT5Xw3Qu/bMY0FoaofWNQO25NyPP+kqjElrFS6emsqKQp4ratrKLgYaEIcgsR+FDv+t3B74hw6tcoTpBN9LajUmsBprhYTJ4tbcEGO4fOjcTPvhtI+0dBw4u5OlJaTuWNNpDVw5597HH60R7n2IP11X34//ksr4sTCznkLCHweG/nKN9v3mx85tTGkQF sma-rsa-key-1367604859ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFV+oz5ZF5A2RZv3hQ+z2Z34YB6QhWqzlWdKr2dV8MO+4qHVEsKCUoqus/FeZy/+fRPPy6rpof5kjwFf4wcRbRRqjdKZXrBoBx0TaCzODPlCyu3HUBTyuXSjkEdalAAcPj8GjLyBRPzH1nrl/+vgKGbh6+MrrVcEUiUmbIkQi/a67KKe8XG3e/RTZzYPONWHpZ6oeVWhqKkF8x6Bd14vg3kOSNddURY4+xp7GJmY8Zhy8v1M8UAtDk7mgbUHbPo2eo8uk7Y+B5G12M3tMFL/Ika++pTGSC/I/IGj9hHsJkg2JrRmFXVrmW6VgbpVMPKkUz5c7GkGjh3XKU4b7eqiY5 [email protected]

Again, running the script again gives another exit code 1 but the correct line is written to authorized_keys.

It seems possible it's to do with accepting the server's key in the same session.

@beautifulcode
Copy link
Owner

Hmm thanks for your help. I will see if I can repro.

@andrewsf
Copy link

I also have this issue. Running ssh-add -L yields:

ssh-rsa AAAA*****ZFhN /Users/******/.ssh/id_rsa

...Which is causing the issue. For this script to work properly, I would expect the command to yield the same thing as cat ~/.ssh/id_rsa.pub, which is:

ssh-rsa AAAA*****ZFhN andrewsf@andrewsf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants