[Top][All Lists]

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

Password issue using sudo through ssh

From: Brice Waegenire
Subject: Password issue using sudo through ssh
Date: Mon, 31 Aug 2015 15:08:14 +0200

Hello all,

I want to access my remote hosts using TRAMP via sudo together with my
local computer. Unfortunately the sudo remote access is inconsistent.

The first time that I access the remote host with sudo (`C-x C-f
/sudo:foo:/') I get ask to unlock my ssh key, then my sudo password
which I enter, it work I have access to the machine. Quickly after I
clean up the connections (`M-x tramp-cleanup-all-connections') and try
to connect to the same host again, the ssh key is cached by my agent, so
I get asked my sudo password, I enter it but then I get stuck to
`Found remote shell prompt on foo'. Whoever if I just type `RET' when I
get asked my sudo password it work.

I think this is related to my sudo config (`/etc/sudoers') which contain
`Defaults timestamp_timeout=10'. But the thing I find strange is that I
have the same config locally but don't have this issue. I can do `C-x
C-f /sudo::/', I get asked my password and get access, `M-x
tramp-cleanup-all-connections', `C-x C-f /sudo::/' the password is
cached for 10 min so I don't get asked my password and get access. I
would like to have that behavior when I'm connecting remotely and not
having to find out if this time I should enter my password or not.

Can you help me with this?

Following is the configuration I use with with `emacs -Q':
| (setq tramp-default-proxies-alist
|       '(((regexp-quote (system-name)) nil nil)
|     (nil "\\`root\\'" "/ssh:%h:")))

I also tried this configuration, but it broke the sudo local access
(ie `/sudo::/'):
| (set-default 'tramp-default-proxies-alist
|          (quote ((".*" "\\`root\\'" "/ssh:%h:"))))

• Emacs: 24.5-1
• TRAMP: 2.2.11-24.5

reply via email to

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