Ruby: Apple/macOS: save your SSH private key password
This documentation is part of the Advanced usages guide. View the full guide here: Going further with your Ruby deployments.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Ruby cloud solution that provides a host of benefits, including:
- Deploy your application in seconds with a simple
git push.- Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
- Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
- Get optimal performance and robust security thanks to a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!
If you are using macOS, you might find it inconvenient to type your SSH private key password every time you push your code. Although security is essential, you can improve convenience by securely storing your password in Apple's Keychain.
It can be tempting to remove the password from your SSH private key, but this is not advisable.
Instead, store your key password in Keychain using the following command for a key named id_ed25519:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
After running this command, you should not be prompted for your key password again. If you use an RSA key, substitute id_ed25519 with id_rsa as shown below:
ssh-add --apple-use-keychain ~/.ssh/id_rsa