Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can connect or copy files to EC2 machine via:

ssh -i my.pem ec2-user@ec2.xxx.compute.amazonaws.com

and

scp -i my.pem file.txt ec2-user@ec2.xxx.compute.amazonaws.com:/home/ec2-user

but I want to manage remote files via Midnight Commander. There are "shell links" but how can I use it with key pair connection?

share|improve this question
up vote 4 down vote accepted

There are "shell links" but how can I use it with key pair connection?

Put the following into ~/.ssh/config:

Host ec2.xxx.compute.amazonaws.com
    User ec2-user
    IdentityFile /path/to/the/my.pem

then try again.

share|improve this answer
    
Excellent! And I can use host alias in Host attribute and real host name in HostName attribute. Nice. Thanks quanta. – mschayna Sep 18 '12 at 11:43
    
How is this working again? I'm adding the config file to /.ssh/config and then how will I use it in Midnight Commander? – Softy Feb 17 '15 at 23:53
    
Totally agree with Softy - then what should I do? I thought that it must detect my.pem file by those settings above for this particular user, when I'll try to connect say - myuser@ec2.xxx.compute.amazonaws.com in Shell Link via mc, err - couldn't chdir. – zeusakm Sep 14 '15 at 12:08

Other way. Enter in console:

ssh-add /path/to/your/key/file_name.pem

After that you can enter your_name@your_address.amazonaws.com in mc shell-connect menu and press Ok

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.