Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit Length Option #3

Open
simon-p-r opened this issue Jul 2, 2014 · 2 comments
Open

Bit Length Option #3

simon-p-r opened this issue Jul 2, 2014 · 2 comments

Comments

@simon-p-r
Copy link

Hi

Nice module however I can't seem to leave passphrase empty and configure the bits length -is that right?

Thanks
Simon

@ericvicenti
Copy link
Owner

Empty passphrase is the default, or you can pass null/false/undefined .

Bit length is not configurable, but you could add an option for it:
https://github.com/ericvicenti/ssh-keygen/blob/master/src/ssh-keygen.js#L50

I'd be happy to merge and release any upgrades you've got, adding this as an opt would be pretty easy.

Also, check out the pem module. It is a more mature alternative which I stumbled upon after writing this module.

@simon-p-r
Copy link
Author

Thanks

I have tried passing null, false or undefined to passphrase but it doesn't work. I have attached code;

var keygen = require('ssh-keygen');
var fs = require('fs');
var config = {
comment: 'wonderful comment',
password: 'testing1234',
location: '/path/to/store/key',
read: true
};

var comment = config.comment;
var password = config.password;
var location = config.location;
var read = config.read;

keygen({location: location,comment:comment, password: password, read: read}, function(err, out){
console.log('SSH keys being created!');
fs.writeFile(location, out.key, function (err) {
if (err) throw err;
console.log('Private key created!');
fs.writeFile(location + '.pub', out.pubKey, function (err) {
if (err) throw err;
console.log('Public key created!');
});
});
});

Maybe you can show me how to override passphrase as trying to make it generic?

Cheers
Simon

@ericvicenti ericvicenti changed the title Options Bit Length Option Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants