This is probably at OpenWRT.org somewhere, but just for my lucky blog readers... if you want to keep your public key on your OpenWRT system so you don't have to remember the goddamned password, here's what I can remember of the steps I took a few minutes ago:

root@OpenWrt:~# mkdir -p /root/.ssh
root@OpenWrt:~# touch /root/.ssh/authorized_keys
root@OpenWrt:~# chmod 700 /root/.ssh
root@OpenWrt:~# chmod 600 /root/.ssh/authorized_keys
root@OpenWrt:~# cd /root
root@OpenWrt:~# ln -s /tmp/dhcp.leases .  # probably not necessary
root@OpenWrt:~# vi /etc/passwd  # change root's dir from /tmp to /root
root@OpenWrt:~# ssh localhost  # verify login before exiting!
Then ^D twice to be back at your local machine. Use addpublickey.sh to place your key in authorized_keys:
$ addpublickey root@  # or whatever the IP is
Now you can ssh and you'll be in like Flint!

Back to blog or home page

last updated 2013-01-10 20:44:05. served from tektonic