New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ssh2-sftp-server

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssh2-sftp-server

SSH2 sftp server

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by42.86%
Maintainers
3
Weekly downloads
 
Created
Source

ssh2-sftp-server : SFTP server for node.js

Works in win32 and linux style.

ssh2-sftp-server is sftp server module written in pure JavaScript it use excellent ssh2 library by Brian White.

Build Status Version

License Code style

Available platform Available platform

Installation

npm install ssh2-sftp-server

Supported API

support most of client requests:

  • OPEN
  • CLOSE
  • REALPATH
  • STAT
  • OPENDIR
  • READ
  • REMOVE
  • RMDIR
  • MKDIR
  • RENAME
  • READDIR
  • WRITE

Usage

"use strict";

const fs         = require('fs');
const {Server}   = require('ssh2');
const SftpServer = require('ssh2-sftp-server');

new ssh2.Server({
  hostKeys: [fs.readFileSync('host.key')]
}, function(client) {
  client.on('authentication', function(ctx) {
    ctx.accept();
  }).on('ready', function() {
    client.on('session', (accept) => {
      let session = accept();
      session.on('sftp', function() {
        var sftpStream = accept();
        new SftpServer(sftpStream);
      });
    });
  });
});

Credits

Keywords

FAQs

Package last updated on 29 Apr 2021

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