kandi background
Explore Kits

sftpserver | SFTP Server | TLS library

 by   ggrandes Java Version: v1.4.0 License: Apache-2.0

 by   ggrandes Java Version: v1.4.0 License: Apache-2.0

Download this library from

kandi X-RAY | sftpserver Summary

sftpserver is a Java library typically used in Security, TLS applications. sftpserver has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.
SFTP Server (SSH File Transfer Protocol) based on Apache MINA SSHD. Open Source Java project under Apache License v2.0.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • sftpserver has a low active ecosystem.
  • It has 59 star(s) with 53 fork(s). There are 10 watchers for this library.
  • There were 1 major release(s) in the last 12 months.
  • There are 1 open issues and 14 have been closed. On average issues are closed in 51 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of sftpserver is v1.4.0
sftpserver Support
Best in #TLS
Average in #TLS
sftpserver Support
Best in #TLS
Average in #TLS

quality kandi Quality

  • sftpserver has 0 bugs and 37 code smells.
sftpserver Quality
Best in #TLS
Average in #TLS
sftpserver Quality
Best in #TLS
Average in #TLS

securitySecurity

  • sftpserver has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • sftpserver code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
sftpserver Security
Best in #TLS
Average in #TLS
sftpserver Security
Best in #TLS
Average in #TLS

license License

  • sftpserver is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
sftpserver License
Best in #TLS
Average in #TLS
sftpserver License
Best in #TLS
Average in #TLS

buildReuse

  • sftpserver releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • sftpserver saves you 680 person hours of effort in developing the same functionality from scratch.
  • It has 1574 lines of code, 142 functions and 10 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
sftpserver Reuse
Best in #TLS
Average in #TLS
sftpserver Reuse
Best in #TLS
Average in #TLS
Top functions reviewed by kandi - BETA

kandi has reviewed sftpserver and discovered the below as its top functions. This is intended to give you an instant insight into sftpserver implemented functionality, and help decide if they suit your requirements.

  • Starts the sshd server .
    • Extracts the modul files from the given URL .
      • Loads htPasswd from configuration .
        • check if the password is valid
          • Log a message .
            • Checks if the given string is encrypted .
              • Creates an AsynchronousFileChannel .
                • Issue a link .
                  • Gets a read only file channel .
                    • Write a list of lines

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      sftpserver Key Features

                      SFTP Server (SSH File Transfer Protocol) in Java, based on Apache MINA SSHD

                      Config:

                      copy iconCopydownload iconDownload
                      #
                      ## Global Options
                      #
                      # Listen on localhost and localnet
                      #sftpserver.global.host=127.0.0.1,192.168.1.1
                      # Listen on TCP port 22222
                      sftpserver.global.port=22222
                      # Enable compression (requires jzlib) (default: false)
                      sftpserver.global.compress=true
                      # Enable dummy shell (default: false)
                      sftpserver.global.dummyshell=true
                      # Enable log request (default: false)
                      sftpserver.global.logrequest=true
                      #
                      ## Configure user "test"
                      #
                      # Password for user (unencrypted-plain-text)
                      #sftpserver.user.test.userpassword=changeit
                      # Password for user (encrypted)
                      sftpserver.user.test.userpassword=$1$156RlTZJ$76bzjtXvDfgvouurtgEI10
                      # PublicKeys for user (OpenSSH format)
                      sftpserver.user.test.userkey.1=ssh-rsa AAAAB3NzaC1yc2EAAAADA...E7uQ==
                      sftpserver.user.test.userkey.2=ssh-ed25519 AAAAC3NzaC1...QfX
                      sftpserver.user.test.userkey.3=ecdsa-sha2-nistp256 AAAAE2VjZ...Z99xM=
                      # Set user home directory (chrooted)
                      sftpserver.user.test.homedirectory=./home/test/
                      # Enable user (default: false)
                      sftpserver.user.test.enableflag=true
                      # Enable write (default: false)
                      sftpserver.user.test.writepermission=true
                      #
                      

                      Running (Linux)

                      copy iconCopydownload iconDownload
                      ./bin/sftpd.sh <run|start|stop|restart|status> [id]
                      

                      Upstart Script (Linux)

                      copy iconCopydownload iconDownload
                      ./bin/sftpd.conf (you can copy to /etc/init/)
                      

                      Systemd Service (Linux)

                      copy iconCopydownload iconDownload
                      ./bin/sftpd.service (you can copy to /etc/systemd/system/)
                      

                      Generate Encrypted Password (Linux)

                      copy iconCopydownload iconDownload
                      ./bin/sftpd.sh <pwd>
                      

                      PHP CURL SFTP Read File?

                      copy iconCopydownload iconDownload
                      $ch = curl_init('sftp://' . $sftpServer . ':' . $sftpPort . $sftpRemoteDir . '/filename.txt');
                      curl_setopt($ch, CURLOPT_USERPWD, '*****:*****');
                      curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
                      curl_setopt($ch, CURLOPT_DIRLISTONLY, '1L');
                      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                      $response = curl_exec($ch); 
                      $error = curl_error($ch);
                      curl_close($ch);
                      
                      file_put_contents("/path/to/save/filename.txt", $response);
                      

                      PHP curl SFTP files list to array?

                      copy iconCopydownload iconDownload
                      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                      

                      Move downloaded files from sftp to custom path in s3 bucket

                      copy iconCopydownload iconDownload
                      #!/bin/bash
                      
                      src_dir=${1:-/tmp/test}
                      s3_prefix="s3://bucket_name/test/"
                      
                      while read -r -d '' line ; do
                          if [[ $(grep -c 'FOO' <<<${line}) -eq 1 ]] ; then
                              echo "copying ${line} to ${s3_prefix}/FOO${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/FOO${line}"
                          else 
                              echo "copying ${line} to ${s3_prefix}/BAR${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/BAR${line}"
                          fi
                      done < <(find "${src_dir}" \( -name 'FOO*.csv' -o -name 'BAR*.csv' \) -print0 )
                      
                      /tmp/test/src/one:
                      BAR_one.csv BAR_one.txt FOO_one.csv FOO_one.txt
                      
                      /tmp/test/src/three:
                      BAR_three.csv FOO_three.csv junk.txt      test.tmp
                      
                      /tmp/test/src/two:
                      BAR_two.csv FOO_two.csv junk.csv
                      
                      copying /tmp/test/src/three/FOO_three.csv to s3://bucket_name/test//FOO/tmp/test/src/three/FOO_three.csv
                      copying /tmp/test/src/three/BAR_three.csv to s3://bucket_name/test//BAR/tmp/test/src/three/BAR_three.csv
                      copying /tmp/test/src/one/FOO_one.csv to s3://bucket_name/test//FOO/tmp/test/src/one/FOO_one.csv
                      copying /tmp/test/src/one/BAR_one.csv to s3://bucket_name/test//BAR/tmp/test/src/one/BAR_one.csv
                      copying /tmp/test/src/two/BAR_two.csv to s3://bucket_name/test//BAR/tmp/test/src/two/BAR_two.csv
                      copying /tmp/test/src/two/FOO_two.csv to s3://bucket_name/test//FOO/tmp/test/src/two/FOO_two.csv
                      
                      #!/bin/bash
                      
                      src_dir=${1:-/tmp/test}
                      s3_prefix="s3://bucket_name/test/"
                      
                      while read -r -d '' line ; do
                          if [[ $(grep -c 'FOO' <<<${line}) -eq 1 ]] ; then
                              echo "copying ${line} to ${s3_prefix}/FOO${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/FOO${line}"
                          else 
                              echo "copying ${line} to ${s3_prefix}/BAR${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/BAR${line}"
                          fi
                      done < <(find "${src_dir}" \( -name 'FOO*.csv' -o -name 'BAR*.csv' \) -print0 )
                      
                      /tmp/test/src/one:
                      BAR_one.csv BAR_one.txt FOO_one.csv FOO_one.txt
                      
                      /tmp/test/src/three:
                      BAR_three.csv FOO_three.csv junk.txt      test.tmp
                      
                      /tmp/test/src/two:
                      BAR_two.csv FOO_two.csv junk.csv
                      
                      copying /tmp/test/src/three/FOO_three.csv to s3://bucket_name/test//FOO/tmp/test/src/three/FOO_three.csv
                      copying /tmp/test/src/three/BAR_three.csv to s3://bucket_name/test//BAR/tmp/test/src/three/BAR_three.csv
                      copying /tmp/test/src/one/FOO_one.csv to s3://bucket_name/test//FOO/tmp/test/src/one/FOO_one.csv
                      copying /tmp/test/src/one/BAR_one.csv to s3://bucket_name/test//BAR/tmp/test/src/one/BAR_one.csv
                      copying /tmp/test/src/two/BAR_two.csv to s3://bucket_name/test//BAR/tmp/test/src/two/BAR_two.csv
                      copying /tmp/test/src/two/FOO_two.csv to s3://bucket_name/test//FOO/tmp/test/src/two/FOO_two.csv
                      
                      #!/bin/bash
                      
                      src_dir=${1:-/tmp/test}
                      s3_prefix="s3://bucket_name/test/"
                      
                      while read -r -d '' line ; do
                          if [[ $(grep -c 'FOO' <<<${line}) -eq 1 ]] ; then
                              echo "copying ${line} to ${s3_prefix}/FOO${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/FOO${line}"
                          else 
                              echo "copying ${line} to ${s3_prefix}/BAR${line}"
                              #aws s3 cp "${line}" "${s3_prefix}/BAR${line}"
                          fi
                      done < <(find "${src_dir}" \( -name 'FOO*.csv' -o -name 'BAR*.csv' \) -print0 )
                      
                      /tmp/test/src/one:
                      BAR_one.csv BAR_one.txt FOO_one.csv FOO_one.txt
                      
                      /tmp/test/src/three:
                      BAR_three.csv FOO_three.csv junk.txt      test.tmp
                      
                      /tmp/test/src/two:
                      BAR_two.csv FOO_two.csv junk.csv
                      
                      copying /tmp/test/src/three/FOO_three.csv to s3://bucket_name/test//FOO/tmp/test/src/three/FOO_three.csv
                      copying /tmp/test/src/three/BAR_three.csv to s3://bucket_name/test//BAR/tmp/test/src/three/BAR_three.csv
                      copying /tmp/test/src/one/FOO_one.csv to s3://bucket_name/test//FOO/tmp/test/src/one/FOO_one.csv
                      copying /tmp/test/src/one/BAR_one.csv to s3://bucket_name/test//BAR/tmp/test/src/one/BAR_one.csv
                      copying /tmp/test/src/two/BAR_two.csv to s3://bucket_name/test//BAR/tmp/test/src/two/BAR_two.csv
                      copying /tmp/test/src/two/FOO_two.csv to s3://bucket_name/test//FOO/tmp/test/src/two/FOO_two.csv
                      

                      "android javax.net.ssl.SSLException: 502 AUTH TLS OK" on HUAWEI smartphone but it works well on a SAMSUNG smartphone. Why?

                      copy iconCopydownload iconDownload
                      android:usesCleartextTraffic="true"
                      
                      android:networkSecurityConfig="@xml/network_security_config"
                      
                      <?xml version="1.0" encoding="utf-8"?>
                      <network-security-config>
                          <base-config cleartextTrafficPermitted="true">
                      </network-security-config>
                      
                      android:usesCleartextTraffic="true"
                      
                      android:networkSecurityConfig="@xml/network_security_config"
                      
                      <?xml version="1.0" encoding="utf-8"?>
                      <network-security-config>
                          <base-config cleartextTrafficPermitted="true">
                      </network-security-config>
                      
                      android:usesCleartextTraffic="true"
                      
                      android:networkSecurityConfig="@xml/network_security_config"
                      
                      <?xml version="1.0" encoding="utf-8"?>
                      <network-security-config>
                          <base-config cleartextTrafficPermitted="true">
                      </network-security-config>
                      

                      Community Discussions

                      Trending Discussions on sftpserver
                      • PHP CURL SFTP Read File?
                      • PHP curl SFTP files list to array?
                      • Move downloaded files from sftp to custom path in s3 bucket
                      • Why does the SFTP Outbound Gateway not start working as soon as I start its Integration Flow?
                      • Nodejs: Not able to download file from sftp server
                      • "android javax.net.ssl.SSLException: 502 AUTH TLS OK" on HUAWEI smartphone but it works well on a SAMSUNG smartphone. Why?
                      Trending Discussions on sftpserver

                      QUESTION

                      PHP CURL SFTP Read File?

                      Asked 2022-Jan-17 at 04:09

                      I am trying to figure out how to read a file and get the contents from a remote SFTP connection via php/curl. I currently have the code below to read a list of files in a directory.

                      $ch = curl_init('sftp://' . $sftpServer . ':' . $sftpPort . $sftpRemoteDir . '/');
                      curl_setopt($ch, CURLOPT_USERPWD, '*****:*****');
                      curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
                      curl_setopt($ch, CURLOPT_DIRLISTONLY, '1L');
                      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                      $response = curl_exec($ch); 
                      $error = curl_error($ch);
                      curl_close($ch);
                      

                      if I change curl_init to the line below (file name added) how can I read that file?

                      $ch = curl_init('sftp://' . $sftpServer . ':' . $sftpPort . $sftpRemoteDir . '/filename.txt');
                      

                      ANSWER

                      Answered 2022-Jan-17 at 04:09

                      The $response variable will contain the file data. If you want to save the file to your server's machine, you can write the contents of that file using file_put_contents.

                      $ch = curl_init('sftp://' . $sftpServer . ':' . $sftpPort . $sftpRemoteDir . '/filename.txt');
                      curl_setopt($ch, CURLOPT_USERPWD, '*****:*****');
                      curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
                      curl_setopt($ch, CURLOPT_DIRLISTONLY, '1L');
                      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                      $response = curl_exec($ch); 
                      $error = curl_error($ch);
                      curl_close($ch);
                      
                      file_put_contents("/path/to/save/filename.txt", $response);
                      

                      If you want to read the plaintext (available for text files, including .txts), then you should be able to simply read the $response variable, which should be a string.

                      Source https://stackoverflow.com/questions/70736241

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install sftpserver

                      You can download it from GitHub.
                      You can use sftpserver like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the sftpserver component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular TLS Libraries
                      Try Top Libraries by ggrandes
                      Compare TLS Libraries with Highest Support
                      Compare TLS Libraries with Highest Quality
                      Compare TLS Libraries with Highest Security
                      Compare TLS Libraries with Permissive License
                      Compare TLS Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.