Wednesday, September 12, 2012

Secure Remote SSH Connection with no passwords OSX 10.7

So why does my method to set up passwordless SSH remote login no longer work with 10.8 Mountain Lion?

It used to be so easy:

  • Generate the key:
    ssh-keygen -b 1024 -t rsa -f id_rsa -P "" 
  • Copy the key to a new file:
    cp authorized_keys2
  • Create the .ssh folder on the target machine
    mkdir .ssh; chmod 0700 .ssh
  • Copy my key to the target machine:
    scp authorized_keys2 root@target:/private/var/root/.ssh

This no longer works on 10.8 Mountain Lion.

Well the solution is very simple:
The name of the file has changed.

The name of the file on the target machine containing the public key has changed.
'authorized_keys2' no longer works.

If you change the name to 'authorized_keys' it will.

That's all folks.

No comments: