Skip to content

Instantly share code, notes, and snippets.

@geta6
Created December 25, 2012 03:08
Show Gist options
  • Select an option

  • Save geta6/4371494 to your computer and use it in GitHub Desktop.

Select an option

Save geta6/4371494 to your computer and use it in GitHub Desktop.
prompt = require 'prompt'
unixlib = require 'unixlib'
schema =
properties:
user:
message: 'Username'
requireed: yes
pass:
message: 'Password'
hidden: yes
prompt.start()
prompt.get schema, (e, res) ->
unixlib.pamauth 'chkpasswd', res.user, res.pass, (success) ->
console.log res.user, success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment