Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passport-ssh

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ssh

SSH authentication for passport

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

passport-ssh

Passport strategy for authenticating with ssh.

Installation

$ npm install passport-ssh

Usage

The ssh strategy authenticates users using ssh. You can specify server credentials to attempt to ssh into. For example:

Basic setup using ssh daemon running on localhost:22

passport.use(new SSHStrategy());

if i tried to login as user bob, the equivalent ssh command would be:

$ ssh bob@localhost

Example using custom hostname and port

passport.use(new SSHStrategy({
  host: "ec2-54-124-59-274.us-west-2.compute.amazonaws.com",
  port: 2200
}));

if i tried to login as user ubuntu, the equivalent ssh command would be:

$ ssh -p 2200 ubuntu@ec2-54-124-59-274.us-west-2.compute.amazonaws.com

You can optionally provide a verify callback to handle custom edge cases

passport.use(new SSHStrategy(
  function(user, done) {
    done(null, user);
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'ssh' strategy, to authenticate requests.

app.get('/secret', passport.authenticate('ssh', { failureRedirect: '/login' }),
  function(req, res) {
    res.redriect("/");
  }
);

Tests

nah

Keywords

FAQs

Package last updated on 10 Nov 2015

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