How to Passwordless SSH to an OpenWrt Router?

The good ssh-copy-id method which works well on common Linux seems not working for OpenWrt router.

How to Passwordless SSH to an OpenWrt Router?

OpenWrt’s SSH server is Dropbear. It can accept normal RSA keys. But the authorized_keys location is not the same as the openssh “~/.ssh/authorized_keys”.

The location for the authorized_keys is

/etc/dropbear/authorized_keys

What you need to do is to put your public key to that file. If you use the default key location ~/.ssh/id_ras.pub, you can do it by this command:

ssh root@YOUR_OPENWRT_ROUTER 
cp /etc/dropbear/authorized_keys /etc/dropbear/authorized_keys.bak

cat ~/.ssh/id_rsa.pub 
| ssh root@YOUR_OPENWRT_ROUTER "cat >> /etc/dropbear/authorized_keys"

Similar Posts

  • SQL layers on NoSQL databases

    What are the SQL layer solution over NoSQL databases such as key/value stores? Phoenix: A SQL layer on HBase: https://github.com/forcedotcom/phoenix They also show some performance results: https://github.com/forcedotcom/phoenix/wiki/Performance F1 – The Fault-Tolerant Distributed RDBMS Supporting Google’s Ad Business: http://research.google.com/pubs/pub38125.html With F1, we have built a novel hybrid system that combines the scalability, fault tolerance, transparent sharding,…

  • Fedora 中文字体设置

    Fedora 一直有中文字体难看的问题, 尤其是在英文环境中. 使用本文中的配置方法可以得到令人满意的中文效果. 此方案中使用字体都为开源且在Fedora源中自带. 此方案对 Fedora 9 – 20 有效. 对于后续版本支持我会确认并更新此文章. 此方案对Gnome, KDE都有效. Firefox 中也有中文难看的问题, 后面会提到. 快速配置方法 如果你想马上配置好,请使用如下命令。此方法测试使用效果良好。 # yum install cjkuni-ukai-fonts cjkuni-uming-fonts # wget https://raw.githubusercontent.com/zma/config_files/master/others/local.conf \ -O /etc/fonts/local.conf 相关英文字体配置可以参考:Improving Fedora Font Rendering with Open Software and Fonts Only. Fedora 系统中文字体的配置方案 使用uming和ukai字体,即AR PL UMing CN等. 中文字体和等宽字体效果如图所示(点击看大图, Firefox 中文字体设置在后面会提到). 方法如下: 安装字体 首先安装这两个字体: cjkuni-ukai-fonts cjkuni-uming-fonts (在Fedora…

3 Comments

  1. you can use ssh-copy-id to manage keys when you you run

    ln -s /root/.ssh/authorized_keys /etc/dropbear/authorized_keys

Leave a Reply

Your email address will not be published. Required fields are marked *