martes, 26 de febrero de 2013
Activar ssh sin password en ubiquiti
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 username@x.x.x.x 'cat >> /etc/persistent/.ssh/authorized_keys'
Now you should be able to login like this
ssh username@x.x.x.x
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!
Fuente: http://robert.penz.name/405/howto-enable-ssh-public-key-authentication-on-ubiquiti-airos-e-g-nanostation2/
Create a script in the same directory
prepare_key_directory.sh
#/bin/bash
chmod 750 /etc/persistent/
cd /etc/persistent/
mkdir .ssh
chmod 700 .ssh
activar_keys.sh
#/bin/bash
for i in 172.18.1.207 172.18.1.208 172.18.1.209 172.18.1.210 172.18.1.211 172.18.1.212 172.18.1.213 172.18.1.214 172.18.1.215 172.18.1.216
do
scp prepare_key_directory.sh $i:~
ssh $i ./prepare_key_directory.sh
cat ~/.ssh/id_rsa.pub | ssh ubnt@$i 'cat >> /etc/persistent/.ssh/authorized_keys'
ssh $i "cfgmtd -w -p /etc/"done
chmod 777 prepare_key_directory.sh
bash -x activar_keys.sh
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario