Howto enable SSH public key authentication on Ubiquiti AirOS (e.g. NanoStation2)

March 31, 2012

First you need to check if the ssh service is enabled and than you need to login and use following commands. First you need to make sure your home directory is the same as mine:

echo ~

should return /etc/persistent, which is used in this Howto. So lets start the actual work:

chmod 750 /etc/persistent/
cd /etc/persistent/
mkdir .ssh
chmod 700 .ssh

Type on the machine you want to be able to use for public key login:

cat ~/.ssh/id_dsa.pub | ssh [email protected] 'cat >> /etc/persistent/.ssh/authorized_keys'

Now you should be able to login like this

ssh [email protected]

without a password. If so you need to make sure that it stays so even after a reboot:

cfgmtd -w -p /etc/

Type reboot to test it!

3 Comments »

RSS feed for comments on this post. TrackBack URI

  1. File name is
    ” ~/.ssh/id_rsa.pub “,
    not “~/.ssh/id_dsa.pub”

    Works fine

    Comment by edwood — April 15, 2012 #

  2. RSA and DSA are different algorithms, both are valid.

    Comment by robert — April 17, 2012 #

  3. For airGrid M5HP with firmware 5.5.6 it does not survive reboot. It works with older firmware….

    Comment by milan — October 22, 2013 #

Leave a comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 24 queries. 0.142 seconds.