Normally it is very easy to convert ssh and scp commands into tramp format for access via dired.

For example

The command line

ssh username@hostname

will become


in emacs.

Unfortunately, I'm unsure how to convert even the simplest CyberArk example command for use with tramp:

ssh username@target-username@target-hostname@cyberark-psm-hostname


How will I be able to use TRAMP to connect via SSH when proxying through a CyberArk Privileged Session Manager server?

I found out this week I will not have access to CyberArk PSM for several more months so I will not be able to test any solutions on my own. My hope is that someone in the community has already figured out how to do this and will share their expertise. Thank you!

1 Answer 1


I've never heard of CyberArk Privileged Session Manager, but from your description adding it to tramp-methods shouldn't be too hard. The simplest way is probably to add an entry with

 (add-to-list 'tramp-methods
               (tramp-login-program "ssh")
                (("-l" "username")
                 ("-p" "%p")
                 ("-e" "none")
               (tramp-remote-shell "/bin/sh")

Then you can use it by opening /psm:target-username@target-hostname:….

  • 1
    Wahoo!!! I successfully tested your answer in emacs 26.x after tweaking the values and adding some parameters from sshx and scpx tramp-methods. With the updates I was able to create new psm-sshx and psm-scpx tramp-methods. Unfortunately for me, when I tested the new config in emacs 25.1, I hit a known tramp bug tramp-file-name-handler: Host ‘remote-hostname’ looks like a remote host, ‘psm-sshx’ can only use the local host. As a temporary work around for emacs 25.1, I added an host alias in my ~/.ssh/config and tramp works normally again. Thank you so much!!!
    – Melioratus
    Mar 12, 2020 at 15:53

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.