Quantcast

Dropbear/SFTP

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dropbear/SFTP

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.


_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Thomas Petazzoni-2
Dear Ted Wood,

On Tue, 8 Jan 2013 11:54:25 -0000, Ted Wood wrote:
> 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
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Willy Lambert
2013/1/8 Thomas Petazzoni <[hidden email]>:

> Dear Ted Wood,
>
> On Tue, 8 Jan 2013 11:54:25 -0000, Ted Wood wrote:
>> 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.
>

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


> 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
> [hidden email]
> http://lists.busybox.net/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Will Moore-2

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Willy Lambert
> Sent: 08 January 2013 12:59
> To: Thomas Petazzoni
>
> 2013/1/8 Thomas Petazzoni <[hidden email]>:
> > Dear Ted Wood,
> >
> > On Tue, 8 Jan 2013 11:54:25 -0000, Ted Wood wrote:
> >> I am attempting to remotely debug application code on  my i586 system from
> >> Eclipse.
> >>
-- snip --

> >
> > 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.

+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 ...

>
> > 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
> > [hidden email]
> > http://lists.busybox.net/mailman/listinfo/buildroot
> _______________________________________________
> buildroot mailing list
> [hidden email]
> http://lists.busybox.net/mailman/listinfo/buildroot


_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Thomas Petazzoni-2
Dear Will Moore,

On Tue, 8 Jan 2013 14:15:01 -0000, Will Moore wrote:

> 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
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Peter Korsgaard-3
In reply to this post by Thomas Petazzoni-2
>>>>> "Federico" == Federico Bianchi <[hidden email]> 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.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Thomas Petazzoni-2
In reply to this post by Thomas Petazzoni-2
Hello,

On Tue, 8 Jan 2013 13:06:18 +0100, Thomas Petazzoni wrote:

> 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
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

thomas
In reply to this post by Thomas Petazzoni-2
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@192.168.1.5") however I am not able to connect to SFTP
server:("sftp root@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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Peter Korsgaard-3
>>>>> "thomas" == thomas  <[hidden email]> 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@192.168.1.5") however I am
 thomas> not able to connect to SFTP server:("sftp root@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.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

thomas
Hello Peter,

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

Here below my simple test:
thomas@thomas-laptop:~/Armadeus/armadeus-5.2$ sftp root@192.168.1.5
root@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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Peter Korsgaard-3
>>>>> "thomas" == thomas  <[hidden email]> 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@thomas-laptop:~/Armadeus/armadeus-5.2$ sftp root@192.168.1.5
 thomas> root@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://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

thomas
This post was updated on .
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@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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Peter Korsgaard-3
>>>>> "thomas" == thomas  <[hidden email]> 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

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

thomas
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@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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

thomas
Hello Peter,

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

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

Thanks again for your support

Best regards,
Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dropbear/SFTP

Peter Korsgaard-3
>>>>> "thomas" == thomas  <[hidden email]> 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.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Loading...