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

How to Add SSH .pem File for EC2 Access #12

Open
Theramya10 opened this issue Oct 4, 2024 · 0 comments
Open

How to Add SSH .pem File for EC2 Access #12

Theramya10 opened this issue Oct 4, 2024 · 0 comments

Comments

@Theramya10
Copy link

Before running this command -> ssh-copy-id -f "-o IdentityFile " ubuntu@

Follow these steps to add your SSH .pem file and avoid manually entering the key each time you connect to your EC2 instance.

1. Add the SSH key to the SSH agent

sudo ssh-add ~/Downloads/id_rsa.pem

2. Move the SSH key to the .ssh directory

mv ~/Downloads/id_rsa.pem ~/.ssh/id_rsa.pem

3. Set correct permissions for the private key (restrict access)

chmod 400 ~/.ssh/id_rsa.pem

4. Add the key to the SSH agent again (if necessary)

sudo ssh-add ~/.ssh/id_rsa.pem

ssh ec2-user@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant