SSH Keys Scripting

Print Friendly, PDF & Email

I’m looking into the ssh keys issues, and trying to solve it with a script.

But the only two I need to solve are cobra and orangutan. But they seem different because  edavis5 can ssh into orangutan, but not cobra. So since I couldn’t ssh into it, I went to the actual machine and checked out its status. Luser was logged in and there were a couple root@tempest shells open…I probably left those. And when I opened a new terminal window it said luser@localhost, so I knew that after the installs a reboot was necessary. So I rebooted and edavis5 could login to cobra and a terminal opened as edavis5@cobra. Additionally I could ssh in.

I thought about what my script would want to do…by looking what was wrong with orangutan and cobra. But I found that they had more differences than I thought. Then I noticed from the ssh keys post (https://blogs.wellesley.edu/cssysadmin/2012/09/26/ssh-keys/) that the part2 script included items meant to fix the ssh keys for new computers, so if that script works, why write another one? So I ran the part2 script on orangutan (since I figured it was idempotent). Then when I ssh’d to orangutan, I didn’t get any errors! Yay!

But then running the part2 script on cobra, gave a lot of errors…yikes! Tracing back the error messages it said “/root/sshkeys/cobra.wellesley.edu/ssh/* doesn’t exist” Oooops! I was the one who changed the ssh keys around for the reptiles with new names…when I copied them from their old name to their new name I left out a directory step. Everything that was supposed to be in /root/sshkeys/cobra.wellesley.edu/ssh/* was in /root/sshkeys/cobra.wellesley.edu/*. So after I moved those to their inner directories, I ran the part2 script on cobra. This seems to have fixed the problem for cobra too! 😀

Then running an all-hosts2 or ah-broadcast, minnow and tamarin are the only two with small error messages, “The authenticity of host ‘tamarin’ can’t be established. Are you sure you want to continue connecting? (yes/no)” But then after you say “yes” it tells you that “Warning: Permanently added ‘tamarin’ to the list of known hosts.” But that isn’t accurate since each time it asks for this. My next challenge/mystery!

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *