转自:http://wiki.openwrt.org/inbox/replacingdropbearbyopensshserver
Replacing Dropbear by openssh-server
- Make sure you have set a root password:
passwd
- Change the Dropbear port to an unused/free one on your box and restart Dropbear:
uci set dropbear.@dropbear[0].Port=2222 uci commit dropbear /etc/init.d/dropbear restart
- Reconnect to your router via SSH on the configured port above:
ssh -p 2222 root@192.168.1.1
- Install the openssh-server
opkg update opkg install openssh-server
- On CC 15.05+, if you want to be able to use a password for root login, edit /etc/ssh/sshd_config and change
#PermitRootLogin without-password
toPermitRootLogin yes
- Enable and start OpenSSH server. OpenSSH will listen now on port 22.
/etc/init.d/sshd enable /etc/init.d/sshd start
- Reconnect to your router via SSH on port 22. If this fails to authenticate with the root password on port 22, you should still be able to connect with Dropbear on port 2222. Test this first and then reboot OpenWRT. After that you should be able to connect with OpenSSH on port 22.
- Now you can disable Dropbear
/etc/init.d/dropbear disable /etc/init.d/dropbear stop
- Install the
openssh-sftp-serverpackage to install support for the SFTP protocol which SSHFS usesopkg update opkg install openssh-sftp-server
- Don't forget to configure the openssh server in /etc/ssh/sshd_config
本文介绍如何在OpenWRT路由器上将默认的Dropbear SSH服务器替换为功能更全面的OpenSSH服务器。步骤包括更改Dropbear端口、安装OpenSSH服务器包、配置root登录权限及启动服务等。
1358

被折叠的 条评论
为什么被折叠?



