3

I'm trying to get tramp to use my ProxyCommand from my ~/.ssh/config (pasted below), specifically for AWS SSM. Should I expect this ProxyCommand to work, maybe something is wrong with my environment or how I'm invoking tramp? Or would tramp need changes to its source to support AWS SSM?

I try C-x C-f /ssh:i-8746484eadb75:/var/log and it asks me if I want to create the directory or file y/n - never seems to even try connecting to the remote host or looking at my ~/.ssh/config and ProxyCommand.

Any pointers or direction would be most welcome, TIA!

Host i-* mi-*
     ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
     User ec2-user

I'm using emacs 26.3 (9.0) on osx catalina 10.15.3.

4
  • Stuff like Host i-* is honored by tramp when connecting to something like /ssh:i-238427:/. At least with my emacs 25.x. Maybe it helps to press <tab> on several occassions? What is AWS SSM by the way?
    – jue
    Commented Feb 27, 2020 at 20:04
  • I haven't used aws ever, so I cannot say anything about. However, I would be willing to debug Tramp for this, if somebody provides me a guest account and basic instructions how to use. Note, I'm the Tramp maintainer. Commented Feb 28, 2020 at 10:00
  • PS: You could contact me directly via [email protected] Commented Feb 28, 2020 at 10:06
  • I'm creating a guest account on a test AWS account, I'll contact you directly over email when I have it working with a set of basic instructions. Thank you! Commented Feb 29, 2020 at 4:57

1 Answer 1

3

Using the temporary test AWS account, I have been able to access that file system via Tramp. Necessary configs are

  1. If you use another AWS profile but default, you shall tell it to Emacs. Add to your ~/.emacs

    (setenv "AWS_PROFILE" "my_profile")
    
  2. Add your private key file to ~/.ssh/config

    Host i-* mi-*
         ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWStartSSHSession --parameters 'portNumber=%p'"
         User ec2-user
         StrictHostKeyChecking no
         IdentityFile ~/.ssh/id_rsa_aws
    
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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