Skip to contentSkip to conversation

Dropbear/SFTP

Buildroot Ted Wood 6 participants 16 messages Jan 8, 2013 – Apr 26, 2013 1 message not in the archive

lore
Share & tools
lore

Ted Wood

author
#0 lore raw

I am attempting to remotely debug application code on my i586 system from Eclipse.

I can login using SSH, however it stops saying that there is no SFTP server running on my target.

I've tried installing open-ssh, I presume I need to initaiate the SFTP server somehow, but I'm not sure how.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130108/4e96eb39/attachment-0001.html>

#1 lore raw

Dear Ted Wood,

Quoted 8 lines · Ted Wood

I am attempting to remotely debug application code on my i586 system from Eclipse.

I can login using SSH, however it stops saying that there is no SFTP server running on my target.

I've tried installing open-ssh, I presume I need to initaiate the SFTP server somehow, but I'm not sure how.

The subject of your e-mail suggests you've tried using Dropbear. However, as you've probably noticed, Dropbear doesn't implement the SFTP protocol, so it is not possible to use Dropbear as a SFTP server.

For now, the only option in Buildroot to get a SFTP server is to use OpenSSH. Just enable the package, disable Dropbear, and do a full rebuild of your Buildroot configuration. The Buildroot OpenSSH package automatically installs an init script that will start OpenSSH at boot time. Nothing special should be necessary.

If you're interested, notice that we are currently developing a Eclipse plugin for Buildroot, which will help to build, remote execute and remote debug applications in the context of Buildroot. The documentation has not yet been fully written, but if you're interested, please let me know so that we can give you the initial starting points. We are very interested in getting some user feedback about those developments.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

2013/1/8 Thomas Petazzoni <[email protected]>:

Quoted 22 lines

Dear Ted Wood,

Quoted 8 lines · Ted Wood

I am attempting to remotely debug application code on my i586 system from Eclipse.

I can login using SSH, however it stops saying that there is no SFTP server running on my target.

I've tried installing open-ssh, I presume I need to initaiate the SFTP server somehow, but I'm not sure how.

The subject of your e-mail suggests you've tried using Dropbear. However, as you've probably noticed, Dropbear doesn't implement the SFTP protocol, so it is not possible to use Dropbear as a SFTP server.

For now, the only option in Buildroot to get a SFTP server is to use OpenSSH. Just enable the package, disable Dropbear, and do a full rebuild of your Buildroot configuration. The Buildroot OpenSSH package automatically installs an init script that will start OpenSSH at boot time. Nothing special should be necessary.

Quoted 8 lines

If you're interested, notice that we are currently developing a Eclipse plugin for Buildroot, which will help to build, remote execute and remote debug applications in the context of Buildroot. The documentation has not yet been fully written, but if you're interested, please let me know so that we can give you the initial starting points. We are very interested in getting some user feedback about those developments.

Even if not concerned by the thread, I'm interested to have a look at this plugin.

Quoted 12 lines

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw
Quoted 14 lines

-----Original Message-----
From: buildroot-bounces at busybox.net [mailto:buildroot-bounces at busybox.net] On Behalf Of Willy Lambert
Sent: 08 January 2013 12:59
To: Thomas Petazzoni

2013/1/8 Thomas Petazzoni <[email protected]>:

Quoted 6 lines

Dear Ted Wood,

Quoted 3 lines · Ted Wood

I am attempting to remotely debug application code on my i586 system from Eclipse.

-- snip --

Quoted 10 lines
Quoted 9 lines

If you're interested, notice that we are currently developing a Eclipse plugin for Buildroot, which will help to build, remote execute and remote debug applications in the context of Buildroot. The documentation has not yet been fully written, but if you're interested, please let me know so that we can give you the initial starting points. We are very interested in getting some user feedback about those developments.

Quoted 2 lines

Even if not concerned by the thread, I'm interested to have a look at this plugin.

+1

I currently configure the eclipse project to pick up the buildroot built cross tools, built my executables in eclipse, run Dropbear on the target, scp my executables to the target, in a ssh connection run gdbserver, and configure eclipse to remote debug using the builtroot built cross tools. I know from QNX Momentics there are much slicker ways ...

Quoted 17 lines
Quoted 13 lines

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#4 lore raw

Dear Will Moore,

Quoted 5 lines · Will Moore

I currently configure the eclipse project to pick up the buildroot built cross tools, built my executables in eclipse, run Dropbear on the target, scp my executables to the target, in a ssh connection run gdbserver, and configure eclipse to remote debug using the builtroot built cross tools. I know from QNX Momentics there are much slicker ways ...

Indeed, what we have now is much better. Thanks to the developments done by M?lanie (Cc'ed), we have an Eclipse plug-in that:

* Automatically detects the Buildroot toolchains that are available on your system, and allows you to select between them. It will automatically adjust the compiler/flags used for compiling your programs (if you're using the "managed build" mechanism of Eclipse, which is the mechanism where Eclipse builds your application for you, as opposed to using external Makefile, CMake or something like that).

* Can automatically copy your application over SSH when you hit the "Run" button, or copy the application + start gdbserver automatically if you hit the "Debug" button.

* Provides a nice list of libraries that are compiled in your Buildroot project (and providing a pkg-config .pc file). You just have to click on a particular library to make your application link against this library. That's the newest feature that has been integrated :-)

M?lanie will work on polishing the update site to make it easy to install all this, and in writing the necessary tutorials. We'll keep you posted once it is ready, but we are definitely looking forward for your tests and experimentations in order to get feedback and be able to do further improvements on this plug-in.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Federico" == Federico Bianchi <[email protected]> writes:

Federico> I faced the very same problem some time ago. When working from Federico> scratch, you can either build the SFTP subsystem from OpenSSH without Federico> installing the rest (it has very few dependencies from the main Federico> package) or work with rjk-sftpserver from
Federico> http://www.greenend.org.uk/rjk/sftpserver/ - but YMMV, and I don't Federico> think there are any premade solutions.

Nice, wasn't aware of this sftpserver implementation. I'll add a Buildroot package for it.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw
In reply to Thomas Petazzoni

Hello,

Quoted 7 lines · Thomas Petazzoni

If you're interested, notice that we are currently developing a Eclipse plugin for Buildroot, which will help to build, remote execute and remote debug applications in the context of Buildroot. The documentation has not yet been fully written, but if you're interested, please let me know so that we can give you the initial starting points. We are very interested in getting some user feedback about those developments.

We have released the first version of the Eclipse/Buildroot integration. See the announcement at
http://lists.busybox.net/pipermail/buildroot/2013-January/065339.html.

We are definitely interested in receiving feedback from users, so do not hesitate to test and report back!

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw
In reply to Thomas Petazzoni

Dear Thomas Petazzoni,

I am in the same case as Ted Wood that is to say I can login using ssh from a console ("ssh root at 192.168.1.5") however I am not able to connect to SFTP server:("sftp root at 192.168.1.5" asks for a password but I got the following error : sh: /usr/libexec/sftp-server: not found
Connection closed)

I am not using dropbear anymore (as it doesn't implement sftp) and enabled
openssh only. I would also want to use Buildroot/Eclipse integration (sounds
perfect) but I don't know which file the patch described here "https://github.com/mbats/eclipse-buildroot-toolchain-plugin/blob/master/buildroot.patches/Integration-with-Buildroot-Toolchain-Eclipse-plugin.patch" should apply to? Moreover I have a buildroot 201204 instead 201211 as
recommanded for the patch.

Hope you could help me

Best regards,
Thomas

--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/Dropbear-SFTP-tp38207p44233.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

#9 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thomas" == thomas <[email protected]> writes:

thomas> Dear Thomas Petazzoni,

thomas> I am in the same case as Ted Wood that is to say I can login thomas> using ssh from a console ("ssh root at 192.168.1.5") however I am thomas> not able to connect to SFTP server:("sftp root at 192.168.1.5" thomas> asks for a password but I got the following error : sh:
thomas> /usr/libexec/sftp-server: not found Connection closed)

You need to use openssh or enable gesftpserver if you use dropbear.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

Hello Peter,

As I wrote, I'm not using dropbear anymore but openssh alone.

Here below my simple test:
thomas at thomas-laptop:~/Armadeus/armadeus-5.2$ sftp root at 192.168.1.5 root at 192.168.1.5's password:
sh: /usr/libexec/sftp-server: not found
Connection closed

Effectively, I have no /usr/libexec/sftp-server folder on my target. Openssh didn't create it... Is there something manual to do in order to activate sftp?

Thanks for your quick reply

Best regards,
Thomas

--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/Dropbear-SFTP-tp38207p44235.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

#11 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thomas" == thomas <[email protected]> writes:

thomas> Hello Peter,
thomas> As I wrote, I'm not using dropbear anymore but openssh alone.

thomas> Here below my simple test:
thomas> thomas at thomas-laptop:~/Armadeus/armadeus-5.2$ sftp root at 192.168.1.5 thomas> root at 192.168.1.5's password:
thomas> sh: /usr/libexec/sftp-server: not found
thomas> Connection closed

thomas> Effectively, I have no /usr/libexec/sftp-server folder on my thomas> target. Openssh didn't create it... Is there something manual thomas> to do in order to activate sftp?

Hmm, indeed. A quick test shows:

make openssh
..
/usr/bin/install -c -m 0755 sftp-server /home/peko/source/buildroot/output/target/usr/lib/sftp-server ..

I guess it's because we're explicitly passing --with-libexecdir=/usr/lib. With that removed I see:

/usr/bin/install -c -m 0755 sftp-server /home/peko/source/buildroot/output/target/usr/libexec/sftp-server

Fixed in git, thanks for the report.

Signature · 1 line
Bye, Peter Korsgaard
#12 lore raw

Hello Peter,

Sorry for the novice question but I haven't manage to found the file where I need to remove --with-libexecdir=/usr/lib

Searching with thomas at thomas-laptop:~/Armadeus/armadeus-5.2$ grep -Rn "with-libexecdir=/usr/lib" *
command, I found the following files :
...
buildroot/output/target/var/log/ssh-diWeFpdL1576/agent.1576: No such
device or address
...
buildroot/output/target/var/log/ssh-diWeFpdL1576/agent.1576: No such
device or address
...
Is it one of this file?
If not, how could I fix the problem by myself?

Thanks in advance
Best regards,
Thomas

2013/4/25 Peter Korsgaard-3 [via Buildroot (busybox)] < [email protected]>

Quoted 51 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thomas" == thomas <[hidden email]<http://user/SendEmail.jtp?type=node&node=44240&i=0>>

writes:

thomas> Hello Peter,
thomas> As I wrote, I'm not using dropbear anymore but openssh alone.

thomas> Here below my simple test:
thomas> thomas at thomas-laptop:~/Armadeus/armadeus-5.2$ sftp
root at 192.168.1.5
thomas> root at 192.168.1.5's password:
thomas> sh: /usr/libexec/sftp-server: not found thomas> Connection closed

thomas> Effectively, I have no /usr/libexec/sftp-server folder on my thomas> target. Openssh didn't create it... Is there something manual thomas> to do in order to activate sftp?

Hmm, indeed. A quick test shows:

make openssh
..
/usr/bin/install -c -m 0755 sftp-server /home/peko/source/buildroot/output/target/usr/lib/sftp-server ..

I guess it's because we're explicitly passing --with-libexecdir=/usr/lib. With that removed I see:

/usr/bin/install -c -m 0755 sftp-server /home/peko/source/buildroot/output/target/usr/libexec/sftp-server

Fixed in git, thanks for the report.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=44240&i=1>
http://lists.busybox.net/mailman/listinfo/buildroot

------------------------------
If you reply to this email, your message will be added to the discussion
below:

http://buildroot-busybox.2317881.n4.nabble.com/Dropbear-SFTP-tp38207p44240.html
To unsubscribe from Dropbear/SFTP, click here<http://buildroot-busybox.2317881.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=38207&code=dGhvbWFzLnNwaXR6QGdtYWlsLmNvbXwzODIwN3wxMjUwOTM0ODE5>
. NAML<http://buildroot-busybox.2317881.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

Signature · 22 lines
<http://www.hestia-france.com/logiciels.html#Superviseur_domotique_Mitra><http://www.hestia-france.com><http://www.hestia-france.com/logiciels.html#Superviseur_domotique_Mitra><http://www.hestia-france.com/configurateur_ZENNIO_ZAS.php>
Hestia France S.A.S
*Fabricant de syst?mes domotiques et d'alarme pour l'habitat et le tertiaire
*
*Manufacturer of Home and Building Management System* *including alarm **
security*

2, rue du Z?cart - 59242 Templeuve - France
Tel: +33 (0)3 20 04 43 68 - Portable: +33 (0)6 26 87 13 93 - ID Skype:
hestia-france - Fax: +33 (0)3 20 64 55 02
 Site web: www.hestia-france.com - Email :
thomas.spitz at hestia-france.com<[email protected]>




--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/Dropbear-SFTP-tp38207p44250.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130425/c28a48cf/attachment.html>
#13 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thomas" == thomas <[email protected]> writes:

thomas> Hello Peter,

thomas> Sorry for the novice question but I haven't manage to found the thomas> file where I need to remove --with-libexecdir=/usr/lib

Use latest git or apply this patch to your buildroot tree:

http://git.buildroot.net/buildroot/commit/?id=b6f71564fbee991a4a88202af541f4229bb99ff0

Signature · 1 line
Bye, Peter Korsgaard
#14 lore raw

Hello Peter,

I didn't use the patch but I directly modified /home/thomas/Armadeus/armadeus-5.2/buildroot/package/openssh/openssh.mk as follows :

/############################################################# #

# openssh
#
#############################################################

OPENSSH_VERSION = 5.9p1
OPENSSH_SITE = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable
OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)"

OPENSSH_CONF_OPT = --disable-lastlog --disable-utmp \
		--disable-utmpx --disable-wtmp --disable-wtmpx --disable-strip

OPENSSH_DEPENDENCIES = zlib openssl

define OPENSSH_INSTALL_INITSCRIPT

	$(INSTALL) -D -m 755 package/openssh/S50sshd

$(TARGET_DIR)/etc/init.d/S50sshd
endef

OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT

$(eval $(call AUTOTARGETS))/

I also resinstalled openssh to be sure It take account of the modified file. Nothing changes. sftp-server is still installed in /usr/lib whereas sftp root at 192.168.1.5 is looking for sftp service on the target in /usr/libexec

Here below a ls from my Armadeus target :

# ls /usr
bin    lib    sbin   share
# ls /usr/lib
libas_devices.so     libncurses.so        libts-1.0.so.0.0.0
libcrypto.so         libncurses.so.5      libts.so
libcrypto.so.1.0.0   libncurses.so.5.7    libz.so
libform.so           libpanel.so          libz.so.1
libform.so.5         libpanel.so.5        libz.so.1.2.5
libform.so.5.7       libpanel.so.5.7      sftp-server
liblzo2.so           libssl.so            ssh-keysign
liblzo2.so.2         libssl.so.1.0.0      ssh-pkcs11-helper
liblzo2.so.2.0.0     libstdc++.so         tc
libmenu.so           libstdc++.so.6       terminfo
libmenu.so.5         libstdc++.so.6.0.13  ts
libmenu.so.5.7       libts-1.0.so.0
# 

Best regards,
Thomas

--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/Dropbear-SFTP-tp38207p44260.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

#16 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thomas" == thomas <[email protected]> writes:

thomas> Hello Peter,

thomas> I finally moved sftp-server from /usr/lib to /usr/libexec thomas> manually on my target.

thomas> According to me, it seems that there is still a problem with thomas> the install script.

Strange. As I showed, it worked for me. Could you try a completely clean rebuild to be sure?

thomas> Thanks again for your support

You're welcome.

Signature · 1 line
Bye, Peter Korsgaard