ssh-rsa-keygen
v1.2.0
Published
A Node.js library to generate RSA SSH key for Aws EC2 pairs
Downloads
11
Maintainers
Readme
SSH RSA Keygen for EC2
SSH RSA Keygen for EC2 is a Node.js library that simplifies the generation of SSH key pairs suitable for use with Amazon EC2 instances.
Installation
To install the package, use npm:
npm install ssh-rsa-keygen
Usage
This library provides a function to generate SSH key pairs for EC2 instances. Here's an example of how to use it:
const { generateSSH } = require('ssh-rsa-keygen');
generateSSH('my-ec2-key').then((keys) => {
console.log('Public Key:', keys.publicKey);
console.log('Private Key:', keys.privateKey);
}).catch((error) => {
console.error('Error:', error);
});
API Reference
generateSSH(keyName)
Generate SSH key pairs for Amazon EC2 instances.
- keyName (string): The base name for the key files (without extension).
Example:
generateSSH('my-ec2-key').then((keys) => {
// Use the generated keys for Amazon EC2
}).catch((error) => {
console.error('Error:', error);
});
Troubleshooting
- If you encounter issues, ensure that you have the necessary permissions to write files to the specified directory.
- Make sure you have Node.js and npm installed.
License
This project is licensed under the MIT License.
Changelog
- 1.0.0 (2023-08-29)
- Initial release