Wednesday, May 20, 2020

AWS: add .pem to SSH agent

Be sure the SSH agent is running.
[ec2-user@ip-10-75-40-54 .ssh]$ ssh-add par-vas-key.pem 
Could not open a connection to your authentication agent.
Start the ssh-agent with:
[ec2-user@ip-10-75-40-54 .ssh]$ eval `ssh-agent -s`
Agent pid 32703
Add .pem:
[ec2-user@ip-10-75-40-54 .ssh]$ ssh-add par-vas-key.pem 
Identity added: par-vas-key.pem (par-vas-key.pem)
Check public key known to the agent:
[ec2-user@ip-10-75-40-54 .ssh]$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClUygT8u3RS02SLEL44XkE... par-vas-key.pem