Socket
Socket
Sign inDemoInstall

github.com/sculley/sftp-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sculley/sftp-server


Version published
Created
Source

SFTP Server


SFTP Server

sftp-server is an in-memory SFTP Server implementation written in Go that can be used in Go unit-tests to test code that interacts with an SFTP server.
Explore the docs »

Report Bug/Issue · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

sftp-server is an in-memory SFTP Server implementation written in Go that can be used in Go unit-tests to test code that interacts with an SFTP server. It is useful for ensuring that your code works correctly with an SFTP server without having to run an SFTP along with your tests or to have to mock the SFTP server which can be a complex task to do.

Built With

Getting Started

Usage

server := sftpserver.New("localhost:2022", "sculley", "password")
if err := server.Start(); err != nil {
    log.Fatal("Failed to start test SFTP server:", err)
}
defer server.Stop()

conn, err := ssh.Dial("tcp", "localhost:2022", &ssh.ClientConfig{
    User: "sculley",
    Auth: []ssh.AuthMethod{
        ssh.Password("password"),
    },
    HostKeyCallback: ssh.InsecureIgnoreHostKey(),
})
if err != nil {
    log.Fatal("Failed to dial SFTP server:", err)
}

client, err := sftp.NewClient(conn)
if err != nil {
    log.Fatal("Failed to create SFTP client:", err)
}

files, err := client.ReadDir("/tmp")
if err != nil {
    log.Fatal("Failed to list files: ", err)
}

for _, file := range files {
    log.Println(file.Name())
}

Issues

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Clone or Fork the project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request to merge into develop

License

Distributed under the Apache License. See LICENSE.txt for more information.

Contact

Project Link: https://github.com/sculley/sftp-server

FAQs

Package last updated on 25 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc