I would like to modify a file on a remote server with emacs on a user I can only access through sudo su - username
without a password.
I am currently able to modify files on my personal space on this server using:
C-x C-f /plink:me@server:/path/file
I read there that I could use the following to open a file as the other user:
C-x C-f /plink:me@server|sudo:other@server:/path/file
The problem is that using this syntax, emacs asks me for a password Password for /sudo:other@server:
which I don't have.. giving an empty password does not work, neither does giving my user's password.
Is there a way to configure tramp to connect to this other user as sudo su - other
would do without asking for a password?
PS: I am using emacs 28.1 on Windows 10.
You could specify a new Tramp method, derived from the
sudo
method:Then you can open a remote file like
Disclaimer: it is untested.