Use .pub key as default and clarify wording for profile create

This commit is contained in:
Anthony J Burton 2016-07-28 00:14:47 -04:00
parent 11cd220c3c
commit c5175ee474

View File

@ -108,7 +108,7 @@ function _createProfile(opts, cb) {
} else { } else {
defaults.url = 'https://us-sw-1.api.joyent.com'; defaults.url = 'https://us-sw-1.api.joyent.com';
var possibleDefaultFp = '~/.ssh/id_rsa'; var possibleDefaultFp = '~/.ssh/id_rsa.pub';
if (fs.existsSync(common.tildeSync(possibleDefaultFp))) { if (fs.existsSync(common.tildeSync(possibleDefaultFp))) {
defaults.keyId = possibleDefaultFp; defaults.keyId = possibleDefaultFp;
} }
@ -151,15 +151,15 @@ function _createProfile(opts, cb) {
'Must be at least 3 characters')); 'Must be at least 3 characters'));
} }
if (!regex.test(value)) { if (!regex.test(value)) {
return valCb(new Error('Must not container a "\\"')); return valCb(new Error('Must not contain a "\\"'));
} }
valCb(); valCb();
} }
}, { }, {
desc: 'The fingerprint of the SSH key you have registered ' + desc: 'The fingerprint of the SSH key you have registered ' +
'for your account. Alternatively, You may enter a local ' + 'for your account (ssh-keygen -l -Emd5). Alternatively, you ' +
'path to a public or private SSH key to have the ' + 'may enter a local path to a public or non-passphrase protected' +
'fingerprint calculated for you.', 'private SSH key to have the fingerprint calculated for you.',
default: defaults.keyId, default: defaults.keyId,
key: 'keyId', key: 'keyId',
validate: function validateKeyId(value, valCb) { validate: function validateKeyId(value, valCb) {