= DropBear porting trouble shooting
공식 사이트 > https://matt.ucc.asn.au/dropbear/dropbear.html
= 문제풀이 사이트 > https://ez.analog.com/thread/17004
Setting up dropbear ssh on busybox uclinux
I am attempting to use dropbear for ssh access.
I followed the instructions on https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dropbear and I have successfully included dropbear in my distribution.
root:/> /usr/sbin/dropbear
Dropbear sshd v0.53.1
Along the way, I encountered a couple of issues building dropbear:
[#7168] 2012R1-RC2 fails to build speex
[#7506] Dropbear does not build
I can telnet to my board (BF609), rcp, and rsh, but I cannot ssh to the board.
When I try to connect from my desktop (Windows + Cygwin), I get the following:
$ ssh -vvv root@10.37.33.113
OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /home/amclach/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.37.33.113 [10.37.33.113] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/amclach/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/amclach/.ssh/id_rsa type 1
debug1: identity file /home/amclach/.ssh/id_rsa-cert type -1
debug1: identity file /home/amclach/.ssh/id_dsa type -1
debug1: identity file /home/amclach/.ssh/id_dsa-cert type -1
debug1: identity file /home/amclach/.ssh/id_ecdsa type -1
debug1: identity file /home/amclach/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
I noticed that dropbear had been installed elsewhere in the image, so I tried adding a symlink and then I updated the /etc/inetd.conf file.
root:/> cat /etc/inetd.conf
shell stream tcp nowait root /usr/libexec/rshd rshd
ftp stream tcp nowait root /sbin/ftpd ftpd -w -S /srv/ftp/
telnet stream tcp nowait root /sbin/telnetd telnetd -i
ssh stream tcp nowait root /usr/sbin/dropbear -i 2 > /dev/null
root:/> ls -la /usr/sbin/dropbear
-rwxr-xr-x 1 root root 182560 Nov 16 2012 /usr/sbin/dropbear
I am also unable to restart it due to an error being reported from the script:
root:/> /etc/init.d/S50dropbear
$Usage: /etc/init.d/S50dropbear {start|stop|restart}
root:/> /etc/init.d/S50dropbear stop
Stopping dropbear sshd: sh: can't execute 'start-stop-daemon': No such file or directory
OK
root:/> /etc/init.d/S50dropbear start
Starting dropbear sshd: sh: can't execute 'start-stop-daemon': No such file or directory
OK
root:/> find . -name "start-stop-daemon"
... returns nothing
How do I make ssh work in my Linux set-up?
I need ssh to use the Target Management (http://www.eclipse.org/tm/) support available in Eclipse.
I am using buildroot and Blackfin GNU tool chain 2012R1. I am also using blackfin-toolchain-uclibc-full, as opposed to blackfin-toolchain-uclibc-default.
>> assign a password for the root on the target board (this may
>> require you to enable the passwd in busybox by make busybox-menuconfig in buildroot)"
Oh!! there's a whole new menu!!
For those who are following this trail, here is what I did to get dropbear working:
1, build dropbear and add it to your image/distribution
2, edit the inetd.conf in uclinux/buildroot/output/target/etc and make sure
that the dropbear being used is in the right directory.
e.g. "ssh stream tcp nowait root /usr/sbin/dropbear -i 2 > /dev/null"
3, run "make busybox-menuconfig" and ensure that passwd is added to your image/distribution
4, build and reboot your board (making sure it picks up the new image).
5, set a root password
6, Run the following to generate your keys
dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
7, Start dropbear on port 8080 "/usr/sbin/dropbear -p 8080"
8, Connect using ssh "ssh root@IP-address -p 8080"
Hopefully this post will be useful as ssh is a useful tool to have up and running on your board.
'보관용' 카테고리의 다른 글
수원 온수골에서 근희 친구들과 (0) | 2014.11.15 |
---|---|
[Switch] 기본 동작 (0) | 2014.11.14 |
[Netlink] A to Z (0) | 2014.11.14 |
[popen & pipe & dup] 좋은 예 (0) | 2014.11.14 |
[BusyBox] hsitory 기능 (0) | 2014.11.14 |