Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request :su and :ssh-sudo #24

Open
a-schaefers opened this issue Aug 1, 2020 · 2 comments
Open

Feature request :su and :ssh-sudo #24

a-schaefers opened this issue Aug 1, 2020 · 2 comments

Comments

@a-schaefers
Copy link

a-schaefers commented Aug 1, 2020

for example, I can type:

C-xC-f /
/ssh:serv1|sudo:root@serv1:
RET

And immediately be tramp root on the remote server. Sudo is more useful than su in this case because not everyone has the root password on a remote server, but many people do have sudo -i access to root.

Additionally if we put in ~/.authinfo or ~/.authinfo.gpg sudo password credentials for the remote server,

machine serv1 login root port sudo password MYSUDOPASSWORD

and if in ~/.ssh/config we have something like,

Host serv1
HostName serv1.example.com
User MYUSERNAME

We can securely tramp as root on remote servers via sudo not needing a password or anything. It can be quite handy. I'd love to have this with a shell-mode shortcut similar to :ssh

In like manner,

:su would be nice for quickly becoming tramp root on your local machine, with e.g. something similar to,

(cd (concat "/su:" (system-name) ":"))
(shell)

and this would not require root's password again, if stored as follows in ~/.authinfo.gpg

machine HOSTNAME login root password MYPASSWORD

@a-schaefers
Copy link
Author

Note: with Emacs 27 or higher it will automatically ask you the credentials and populate your .authinfo file for you, too!

@riscy
Copy link
Owner

riscy commented Aug 20, 2020

Apologies for the delayed reply -- this looks like a solid idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants