2

I'm trying to connect to an embedded device through ssh. However, when trying to connect, I always get a connection refused message even when I try changing the port number. I've tried everything to resolve this issue, from changing the file in /etc/ssh/ to accept the specific port number, to sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT .

After reading some comments, it came to me that maybe one of the problems is that I don't have ssh installed on my embedded device. So, how do I infact install ssh on an embedded device? I'm working with a FOX G20 V board with an ATMEL AT91SAM9G20.

I would appreciate any help since I've been stuck on this problem for several days now.

Adam
  • 2,384
  • 7
  • 29
  • 66

2 Answers2

5

You need to cross compile OpenSSH for your embedded device,Follow below steps

  1. Download OpenSSH from http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.6p1.tar.gz
  2. extract it and cross-compile it using toolchain

    ./configure --host="board architecture"

    make

  3. Copy sshd from compiled source and download it in your embedded device and run it

    /path/sshd

  4. Try to connect with your embedded device

Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
  • Thank you for your answer. Once I get the compiled source, how exactly do I download it to my embedded device and run it? And what do you mean by "/path/sshd"? Thanks. – Adam Apr 22 '14 at 12:12
  • If you have serial port access of embedded device then you can download sshd into your board using tftp, /path/sshd/ mean you have to run sshd from path where you have downloaded it – Rahul R Dhobi Apr 22 '14 at 12:14
  • I'm sorry I'm very new to this but I'm using an arm embedded toolchain: `arm-none-eabi-gcc` so what exactly do I have to type in the command line argument to cross compile (once I've downloaded OpenSSH)? Also, I don't have tftp installed nor can I install it. What's another way to download the compiled source onto the embedded device? Thanks. – Adam Apr 22 '14 at 12:18
  • first set path of your toolchain in terminal then ./configure --host=arm-linux CC=arm-none-eabi-gcc AR=arm-none-eabi-ar make – Rahul R Dhobi Apr 22 '14 at 12:26
  • Do you have serial access? – Rahul R Dhobi Apr 22 '14 at 12:28
  • What do you mean by serial access? But ok I'll type ./configure --host=arm-linux CC=arm-none-eabi-gcc AR=arm-none-eabi-ar make in the openSSH directory I presume? – Adam Apr 22 '14 at 12:40
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/51184/discussion-between-rahul-r-dhobi-and-john-smith) – Rahul R Dhobi Apr 22 '14 at 12:45
  • @RahulRDhobi I have a similar problem . Through tftp i have copied sshd which was prebuilt for arm to /etc/sbin/. I tried to run the demon but it is showing the message "./sshd not found ". but the file is present there. What could be the reason?? – kernel Apr 17 '15 at 09:42
  • @kernel:Don't use prebuild binary instead compile using your toolchain might be they compiled sshd using different toochain – Rahul R Dhobi Apr 18 '15 at 04:33
4

This may come a bit late, but may be useful for someone, but for a embedded device you may want also to consider:

As far as I know all of them should work on ARM, you will probably have to cross compile as Rahul R Dhobi said.

pconcepcion
  • 5,591
  • 5
  • 35
  • 53