Git Product home page Git Product logo

sftpd's Introduction

SFTPD

Sftpd is the sftp server by nodejs, with permission virtual path.

中文文档

Configuration

Cofigure file is 3 parts:

  1. App configuration,it's store at the executable file path, filename: app.config.json.
  2. User configuration, it's store at user home dir, filename: .sftpd.json.
  3. Workspace configuration, it's store at cwd, filename: .sftpd.json.

The configuration load order: App configuration -> User configuration -> Workspace configuration,The post-loaded configuration overrides the previously loaded configuration.

Settings:

# example/app.config.json

{
  // The host cert file,the ${appRoot} variable is dir of then executable file。
  "hostKeyFile": "${appRoot}/host_rsa",
  // default data dir, user root dir on that "dataDir/username"
  "dataDir": "${appRoot}/datas",
  // Greetings message
  "greeting": "Good luck!",
  // banner message
  "banner": "Wellcome to SFTP test server.",
  "ident": "sftp server by jover",
  // use debug mode
  "debug": true,
  // The maximum of connections for server
  "maxConnections": 1000,
  // user list
  "users": [
    {
      "username": "test1",
      // Password, encryption by hmac-sha256,and format with base64 encoding.
      "password": "4Dp32BhmHO533HGr5Pp3wFuZT216jc5hGLjxGGV+BOw=",
      // User root dir, the location of virtual path "/"
      "rootDir": "${appRoot}/datas/testUser",
      // The maximum of connections on for user
      "maxConnections": 1,
      "permission": {
        "MKDIR": true,
        "RMDIR": true,
        // read file
        "READ": true,
        // write file
        "WRITE": true,
        // Remove file
        "REMOVE": true,
        // Create file
        "CREATE": true
      }
    },
    {
      "username": "test2",
      "password": "4Dp32BhmHO533HGr5Pp3wFuZT216jc5hGLjxGGV+BOw=",
      "permission": {
        "MKDIR": true,
        "RMDIR": true,
        "READ": true,
        "WRITE": true,
        "REMOVE": true,
        "CREATE": true
      }
    }
  ],
  // server listen port
  "port": "22",
  // Is enable ttl,default value false
  "ttlEnable": false,
  // lock
  "ipLockTimes": 5,
  // If connections count is over ipLockTimes in ipLockSpan by same ip, the ip will be locked.
  "ipLockSpan": 300,
  // If not locked, the connections cout will be clean after ipLockTTL seconds.
  "ipLockTTL": 30,

  // log4js configrations see:`https://github.com/log4js-node/log4js-node`
  // "log": {...}
}

Developement

npm install
npm run example

Command

Pls look for help:

sftpd -h

Version

1.0.3

  • add reconfigure command, support hot reload config
  • add stop command, stop service

Thanks

sftpd is base by ssh2, thanks mscdex。

sftpd's People

Contributors

jovercao avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.