Questions tagged [sudo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

Why is sudo not working in org babel tramp?

I have this code here. I also tried adding sudo touch. The only thing that seems to work is if I run it as a normal bash org code and use the SUDO_ASKPASS variable. #+begin_src bash :results output :...
ritchie's user avatar
  • 149
0 votes
0 answers
45 views

install pdf-tools without sudo

I have installed (a working version of (doom)) Emacs on a remote linux cluster (via conda) for which I do not have sudo access, my question is: how can I install pdf-tools? Thanks Assume I can install ...
georg's user avatar
  • 127
0 votes
0 answers
36 views

reopen-with-sudo command that works through tramp?

I have tried to define this command: (defun etc-reopen-with-sudo () (interactive) (let* ((vec (tramp-dissect-file-name (buffer-file-name (current-buffer)))) (method (tramp-file-name-method ...
Joseph Garvin's user avatar
1 vote
1 answer
84 views

How to overwrite protected files in dired

I was trying to copy my some of my config folders to another system which was mounted with root privileges using dired. I opened both surrounding folders using /sudo::/... and tried to copy my files ...
Alexander Praehauser's user avatar
1 vote
1 answer
248 views

how to execute sudo su --login username command with TRAMP

I have this weird setup that once I log onto our server with the sudo uat command, I will be logged in with my own user dadinn@uat. I have set up .ssh/config so that uat is really an alias for ...
Daniel Dinnyes's user avatar
0 votes
1 answer
183 views

How to open serial-port with root privileges

When I try to open /dev/ttyUSB0 with serial-term, following permission error shows: Opening serial port: Permission denied, /dev/ttyUSB0 I know I can add my user to a group that has access to /dev/...
Garid's user avatar
  • 619
0 votes
1 answer
205 views

How can I change TRAMP sudo password timeout?

I'm asked far too often for my sudo password by TRAMP.
fred's user avatar
  • 21
0 votes
0 answers
14 views

dired: read/write access to local folder contents (root/wheel), similar to "sudo -s" [duplicate]

The local folder /private/var/root (owner: root / group: wheel) on OSX (El Capitan) contains certain data that I would like to have "read/write" access; e.g., /private/var/root/Library/...
lawlist's user avatar
  • 19.1k
0 votes
1 answer
97 views

Trying to edit/save file with root privilege fails with "Copying directly failed, see buffer '*tramp/sudo root @HOST*'

I have done this a ton of times in the past 10 months or so that I have been using Emacs (which I have quickly come to love, by the way) and never had a problem. No clue what I changed or how, but ...
user2800929's user avatar
0 votes
1 answer
390 views

How to avoid using auth-sources when editing with sudo?

When I invoke crux-sudo-edit, Emacs hangs forever with the following message: Decrypting /home/$USER/.authinfo.gpg...0% until I press C-g, then it asks: Passphrase for symmetric encryption for /home/$...
Daanturo's user avatar
  • 180
0 votes
0 answers
263 views

`sudo !!` in eshell?

I was wondering how you could get the equivalent of sudo !! in eshell. I cant tell you the amount of times I have done this forgetting eshell doesn't have this feature built in. I have looked through ...
Nicholas Hubbard's user avatar
0 votes
1 answer
68 views

change the privileges of opening a file when it has already jumped to a remote host using tramp

Good afternoon. To visit the local sudo privilege file, I use the tramp command: Ctr+f //sudo::/путьКфайлу Is it possible to open a remote file with sudo privileges if emacs already uses tramp, and ...
uanr81's user avatar
  • 169
1 vote
0 answers
194 views

Differing behaviours with EDITOR=emacsclient between git and sudoedit

In my .profile I've export EDITOR="emacsclient -qa \"emacs --no-window-system --no-desktop\"" Doing sudo -e /somefile doesn't work even when Emacs server is running. I get emacsclient: ...
legends2k's user avatar
  • 207
1 vote
1 answer
255 views

Sudo caching on compilation mode

There is a command I run very often using compile that must be run as sudo. I wanted to achieve something similar to the 5min caching of sudo in a shell: if I keep running the command in intervals ...
Vitorqb's user avatar
  • 103
0 votes
2 answers
190 views

Emacs, .historian and root user

I use the following alias: alias e='emacsclient -a '\'''\'' -t alias sudo='sudo ' That way I can execute both, commands and aliases, with sudo, including e, which launchs the emacs server if it is ...
ABu's user avatar
  • 280
3 votes
2 answers
1k views

Can I acquire root privilege to edit a system file without restarting emacs with `sudo`? [duplicate]

Sometimes, when I am running an emacs process (either started withemacs -nw or emacsclient -nw with an emacs server daemon), I would like to edit a system file. Can I acquire root privilege without ...
Tim's user avatar
  • 4,997
13 votes
2 answers
3k views

How to execute sudo command in org-babel in relative path under current working directory

I want to execute sudo command in org-babel like this: #+begin_src shell :dir "/sudo::" :cache no make sudo make install #+end_src It works fine. It use TRAMP /sudo: method. But I need to execute ...
stardiviner's user avatar
  • 1,908
1 vote
2 answers
1k views

How to make Org-Babel support tangel to su/sudo file with tramp-sudo?

I hope to let org-babel can tangle to root permission file with tramp-sudo support like the following format: #+BEGIN_SRC clojure :dir /sudo:: :tangle "/etc/kk.clj" ... #+END_SRC But it does not ...
stardiviner's user avatar
  • 1,908
0 votes
0 answers
135 views

Error when trying to save a file as root using Tramp and sudo

I am following the directions laid out in this answer to edit my sshd_config file. However when I try to save I get: byte-code: Wrong type argument: listp, 126 Does anybody know why this would be ...
Startec's user avatar
  • 1,344
2 votes
1 answer
2k views

How to run sudo commands using shell-command?

When I run any sudo command using shell-command—for example, (shell-command "sudo ls")—I get the following error: sudo: no tty present and no askpass program specified How can I get around this? I'm ...
sid-kap's user avatar
  • 544
2 votes
2 answers
3k views

How to edit and save an extremely stubborn read-only file

I am trying to edit the file /etc/postfix/main.cf but this applies to any file. Currently its permission bits are set to -rw-r--r-- I want to open, edit and save this file when operating as a ...
Startec's user avatar
  • 1,344
2 votes
2 answers
1k views

How do I open a non-readable file from inside emacs when I opened emacs as a regular user?

The question pretty much says it all. I opened emacs as a regular user and am trying to edit something in the /etc/ folder (I know this is dangerous etc. etc.) How can I do this?
Startec's user avatar
  • 1,344
0 votes
2 answers
270 views

change default tramp path for finding files

I found the following code here, (defun sudo-find-file (file-name) "Like find file, but opens the file as root." (interactive "FSudo Find File: ") (let ((tramp-file-name (concat "/sudo::" (...
salman's user avatar
  • 103
5 votes
2 answers
1k views

"sudo emacs" Doesn't Work

I am trying to use sudo emacs with no luck so far. When I run with --debug-init I get the following. Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory "web-...
Adam Thompson's user avatar
3 votes
2 answers
2k views

How to sudo save file in TRAMP mode?

I just started using tramp mode, and it looks amazing. However, there's one issue that's making it non-usable for me. I have several boxes which I log into with one user, say, user. He's in sudoers ...
gregoltsov's user avatar
9 votes
1 answer
1k views

How to disable auto-save in emacs only for files opened as root

I want to use emacs auto-save feature with tramp, but only for file that I don't open using sudo. My current configuration, based on the tramp documentation, looks like this: ;;;;;;;; BAKUCP ;;;;;;;; ...
radious's user avatar
  • 231
4 votes
1 answer
119 views

Install programs which require superuser permissions

I would like to, as part of Emacs Lisp package set-up process to run some programs which typically require superuser access, for instance, I would like to make sure that certain system packages are ...
wvxvw's user avatar
  • 11.3k
2 votes
1 answer
499 views

How to prevent tramp from blocking when entering password?

For my speech recognition mode I have emacs listen asynchronously using make-network-process for messages sent by my python client. If I say anything that should translate to emacs taking an action ...
Joseph Garvin's user avatar
2 votes
1 answer
568 views

Prevent Tramp from asking for a password for passwordless sudo

Opening /sudo::/etc/hosts with tramp prompts for a password even though I have passwordless sudo. I use ido. $ sudo grep NOPASSWD /etc/sudoers %wheel ALL=(ALL) NOPASSWD: ALL Is there any way to fix ...
Joe Hillenbrand's user avatar
6 votes
0 answers
620 views

Cannot edit a file as root if ~/.authinfo.gpg file exists

I got ~/.authinfo.gpg to store my multiple email accounts for gnus, but if ~/.authinfo.gpg exists, the tramp won't work. It will always say: Decrypting /home/chz/.authinfo.gpg...done Emacs won't ...
CodyChan's user avatar
  • 2,649
97 votes
5 answers
34k views

Edit file with super-user rights

When you have to edit system files, it's an usual situation that you launched Emacs with a normal user before, so the file will be write-protected. What can I do to gain root privileges? I mean ...
smonff's user avatar
  • 1,579