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
SSH to AWS EC2 with Key File #15
Comments
Digging around online I found that you can specify "keys" as part of the options after host, username.
|
For those on Rails, you can use the param :key_data to put a string directly in the gateway. This means you can store your PK in the encrypted rails credentials system.
In the above example, this will create a port to connect ActiveRecord to a serverless postgresql aurora DB, but tunneling through a generic (unmodified) AWL Linux 2 AMI.
The only caveat here is that if you store the PK as a string, it needs to include the \n character as appropriate. ie. your credentials should look like this when you do
For your own reference, you can find the full list of params in Net::SSH.start https://www.rubydoc.info/github/net-ssh/net-ssh/Net/SSH#start-class_method ...perhaps consider adding this solution in a project wiki until a better one comes along? |
I was connecting to a virtual server on namecheap via SSH as follows
we have now migrated to AWS EC2 and connect to the instance using a key file *.pem. How do I use this gem with the key file to create an SSH tunnel?
Yours assistance is greatly appreciated. Many thanks
The text was updated successfully, but these errors were encountered: