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!

4 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 #

  4. For bullet with old software and old aircam configuration did not survive through reboot as well. However after doing this again and issuing ‘save’ command and rebooting, it seems to be working.

    Comment by naven — December 1, 2015 #

Leave a comment

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

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 36 queries. 0.061 seconds.