[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp no longer connects to aws instances

From: Michael Albinus
Subject: Re: Tramp no longer connects to aws instances
Date: Sat, 26 Oct 2019 15:20:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Frederick Bartlett <address@hidden> writes:

Hi Fred,

> Here's your shell experiment (same result as from inside Emacs):
>     $ ssh -l ec2-user  -o ControlMaster=auto -o ControlPath='tramp.%C'
>     -o ControlPersist=no -e none
>     address@hidden: Permission denied
>     (publickey,gssapi-keyex,gssapi-with-mic).
> And here's my usual ssh command (which works):
>     ssh -i <path_to_public_key_file> -o ServerAliveInterval=5 -o
>     ServerAliveCountMax=1 address@hidden

The difference is "-i <path_to_public_key_file>". Is it located
somewhere else but in ~/.ssh? An unusal name? And is it really a public
key file? Ususally, "-i" specifies the identity (private key) file.

> Could I edit the Tramp command in Emacs to include a reference to
> public key?

Sure. Have a look at tramp-methods. There is an entry like

--8<---------------cut here---------------start------------->8---
  (tramp-login-program "ssh")
   (("-l" "%u")
    ("-p" "%p")
    ("-e" "none")
  (tramp-remote-shell #1#)
--8<---------------cut here---------------end--------------->8---

You could overwrite the tramp-login-args element, via a connection
property "login-args". Consult the docstring of tramp-methods for the
meaning of the %x templates. And consult the Tramp manual about
connection properties at (info "(tramp) Predefined connection

Alternatively, you could add an entry in your ~/.ssh/config like this:

--8<---------------cut here---------------start------------->8---
Host foo
        User            ec2-user
        IdentityFile    /path/to/identity/file
--8<---------------cut here---------------end--------------->8---

With this, you can use Tramp via "/ssh:foo:". And also in your shell,
you can call directly "ssh foo".

> Thanks,
> Fred

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]