Announcement Announcement Module
Collapse
No announcement yet.
SSH Adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SSH Adapter

    Hi all,

    Looks like I am burning some new trails here. I now have a requirement to make a SSH/SCP adapter that works like the FTP adapter. Any suggestions and pointers most welcome. In the mean time I am looking into how I can adapt the FTP adapter to make is SSH aware. I have found JSch opensource libs that will do the work for me, now just how to roll it into Spring and make an adapter...hmmm. Giving it a shot but I am very open to some assistance in any way. Thanx

  • #2
    Making some good progress with the SSH adapter using JSch opensource lib, anyone interested in it? I'd like to contribute the src to the SI EXT, giving something back to the Spring Community...

    Comment


    • #3
      YaY!

      See http://jira.springframework.org/browse/SESIA-17. You'll need to sign your soul over to SpringSource before it can go into SESIA, but if you check the code into github somewhere I'll definitely have a look.

      Comment


      • #4
        Originally posted by iwein View Post
        YaY!

        See http://jira.springframework.org/browse/SESIA-17. You'll need to sign your soul over to SpringSource before it can go into SESIA, but if you check the code into github somewhere I'll definitely have a look.
        cool ok, almost done with it, havent managed to work on it for a while, but now I'm back on it. Should have a working prototype within the next week or two.
        I will keep this thread up to date with regards to my progress.

        Essentially, we've replaced the FTP stuff with SSH, using the Jsch API.

        Almost done!

        Comment


        • #5
          Hi,

          so happy to see someone else is also working on this

          I have to solve the problem that I have to fetch files from a SFTP server that is only accessible with private/public keys. No Username/Password on this box

          Does your code require Spring 3.0? If not, could you share a preview of your work before it gets committed into the Spring SVN repository? We are very eager to use SI in this project...


          Regards,
          Hakan

          Comment


          • #6
            Originally posted by hakan42 View Post
            Hi,

            so happy to see someone else is also working on this

            I have to solve the problem that I have to fetch files from a SFTP server that is only accessible with private/public keys. No Username/Password on this box

            Does your code require Spring 3.0? If not, could you share a preview of your work before it gets committed into the Spring SVN repository? We are very eager to use SI in this project...


            Regards,
            Hakan
            Hi Hakan,

            We have completed the push (outbound adapter) to a ssh server, but the pull will be a little tricker, but we should be finished shortly. We've also implemented push a little differently, by actually adding a path property, where the file gets moved to, once pushed. A bit of housecleaning built in. Otherwise, all the files in the local working directory get resent again, should the process be restarted. This might not be the desired behaviour in some cases. Usually, you want to send the file once only.

            Just make sure you need to SFTP as oppossed to pure SSH. I thought this stuff was all the same, but SSH is different to SFTP is different to normal FTP.
            As I understand it, SFTP is FTP over SSH by proxy. With SSH, the connection and file management operation is completely different, as there is a key exchange with SSH and a username / password, whereas FTP just uses a username / password. We opted to not work with SFTP as this uses SSH via proxy and we didnt like that as oppossed to proper/direct SSH.

            The code is pretty useable at the moment and its going to take some time before it ends up back into Spring I suspect, but its not Spring 3.0 dependant and we will publish a workable version in the interim, so you welcome to get a cut of the code as soon as we done with the pull.
            What is also an option is to have a small SSH push adapter on the remote machine, instead of pulling from the remote machine, just push from there. We might opt this route as then you only need a push adapter and not a pull. But for completeness and conformity, we will complete both push = outbound and pull = inbound ssh adapters as per the ftp sample. Will keep in touch and drop a cut of the adapter on a wiki somewhere soon.

            Comment


            • #7
              If you send me a zip I'll clean it up and put it up on github (with attribution of course). But this is easy enough to do yourself if you have the odd hour to spare. As soon as that happens I'll set the wheels in motion to get it added to the extensions project at least. To be honest that project isn't very lively, but it's under the Spring umbrella, so that might help people find it.

              Just let me know where you need help and I'll free up some time to make things happen.

              Comment


              • #8
                Thanx Iwein,

                We have now completed the adapter and I will send you a zip copy over the next cpl days. A very bright student from one of our local universities' actually completed most of the code, while he was here on his bursary work program. So well done Francois Van Niekerk Code coming soon, thanx Iwein.

                I am just not happy that the ssh and ftp username and password are in clear text in the application context xml. I'm looking for ideas so that the username and password can be protected somehow?

                regards

                Comment


                • #9
                  Awesome

                  To protect the username/password I usually use a properties file or a system parameter, but with expression language support in Spring 3 you can do anything you want.

                  Comment

                  Working...
                  X