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

I can connect or copy files to EC2 machine via:

ssh -i my.pem


scp -i my.pem file.txt

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

2 Answers 2

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:

    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 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 - in Shell Link via mc, err - couldn't chdir. –  zeusakm Sep 14 at 12:08

Other way. Enter in console:

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

After that you can enter in mc shell-connect menu and press Ok

share|improve this answer

Your Answer


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.