Tuesday, 21 May 2013

Why is SSH not honoring my authorized keys?

Why is SSH not honoring my authorized keys? I have 2 laptops at home, both running Ubuntu 12.04 (Desktop), and both using the same NetGear wifi router. I used a technique called "MAC binding" on one of the machines so that the router always assigns it the same 192.168.1.52 IP address every time it tries to connect to the Internet. (Unrelated: MAC binding just means configuring the router to always bind a specific MAC address to a specific IP.) So now, I have 1 laptop that always gets assigned a random IP in the 192.168.1.1 to 192.168.1.50 range, and 1 laptop (my "build server") that always get assigned 192.168.1.52. I am trying to write some bash script that I will run on the "client" laptop (the random IP machine) that will ssh into the build server (192.169.1.52 machine); hence the necessity for the build server to have a "dedicated" IP from inside my LAN. I don't want to have to explicitly feed these bash scripts a password, so I followed the instructions in this article here to generate SSH keys. Specifically, I: Generate SSH keys on my client laptop (producing an id_rsa.pub file) I scp'd the id_rsa.pub file to my build server, and cat'd it into the ~/.ssh/authorized_keys file. I verified that my client laptop's SSH key now exists inside the authorized_keys file on the build server. I closed the terminal on my client laptop and then reopened a new one, just for good measure (in case Linux needs that in order to restart anything, etc.) I then tried to SSH into the build server, and am still being prompted for a password! What's going on here? Why is SSH on my build server not honoring the authorized keys from my client laptop? Do I need to restart anything on the build server (sshd, etc.)? Have I missed any crucial steps here? How to start troubleshooting? Thanks in advance!

No comments:

Post a Comment