11

I can connect or copy files to EC2 machine via:

ssh -i my.pem [email protected]

and

scp -i my.pem file.txt [email protected]:/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?

1

2 Answers 2

15

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.

3
  • Excellent! And I can use host alias in Host attribute and real host name in HostName attribute. Nice. Thanks quanta.
    – mschayna
    Sep 18, 2012 at 11:43
  • 1
    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, 2015 at 23:53
  • 1
    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 - [email protected] in Shell Link via mc, err - couldn't chdir. Sep 14, 2015 at 12:08
7

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

2
  • That was easy, thanks. Still works in 2021
    – A.W.
    Nov 13, 2021 at 7:37
  • And it still works in 2024.
    – korst1k
    Dec 26, 2023 at 5:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .