Socket
Socket
Sign inDemoInstall

ssh2-sftp-server-linux

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ssh2-sftp-server-linux

SSH2 sftp server


Version published
Weekly downloads
2
Maintainers
1
Install size
480 kB
Created
Weekly downloads
 

Readme

Source

ssh2-sftp-server : SFTP server for node.js - FIXED to work in linux

FORK OF:

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

Version License

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

Last updated on 01 May 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc