5

I want to enable SSH service on BusyBox server (currently I can connect only via Telnet), so I think , that I need to compile SSH server , and send it to BusyBox router. So my question is - how to create SSH server binary to send it to BusyBox via FTP?

jbm
  • 3,063
  • 1
  • 16
  • 25
Optimon
  • 723
  • 1
  • 8
  • 17
  • Just compile a SSH daemon for MIPS or whatever your router arch is and you won't have to recompile all of busybox. – MeetTitan Apr 27 '16 at 16:15
  • @MeetTitan how to get known what is my router's arch? What command I should enter to get it? – Optimon Apr 27 '16 at 16:17
  • That would be hard to pinpoint without some environment specific information, such as which model of router you're using and which firmware it is running. – MeetTitan Apr 27 '16 at 22:07
  • You'll probably want to start by mounting the root partition as read/write because most routers are configured to mount / as read only. So, figure out your router arch, compile a compatible binary (Perhaps with static linked libs), upload to a temp folder, give the binary executable permissions, remount / as RW if needed, and move your binary to a folder within your $PATH variable. Then you'll want to check if `/etc/rc.local` exists and throw any commands you'd like run on boot in there. **WARNING, YOU MAY BRICK YOUR ROUTER IF YOU EITHER ENTER A COMMAND THAT DOES NOT RETURN, OR ERRORS OUT!!!** – MeetTitan Apr 27 '16 at 22:32
  • openwrt is available for many routers and has dropbear support... – Phil Brooks Jul 26 '16 at 19:14

1 Answers1

9

You're taking a wrong direction.

1/ "How to enable SSH on BusyBox."

You can't.

2/ And "without recompiling BusyBox?"

You won't, because #1.

Because busybox in itself does not provide an SSH server nor client.

Now that your question is answered:

The usual way to add an SSH server to a busybox based system is to add dropbear, first on the list of "tiny utilities whose functionality is not provided by busybox":

https://busybox.net/tinyutils.html

https://matt.ucc.asn.au/dropbear/dropbear.html

How to compile dropbear (because you will have to), then install and run on your system is now another topic, on which no one can help you without further details on your target system or your cross toolchain.

jbm
  • 3,063
  • 1
  • 16
  • 25
  • Because you will have to ->> https://forum.xda-developers.com/showthread.php?t=767433. Already compiled dropbear. – m3nda Feb 08 '17 at 02:54