Questions tagged [sudo]

The sudo command is a program for some Unix and Unix-Like operating systems, that allows a user to execute programs with the security privileges of another user. Typically those of a superuser or the root user.

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

How to have sudo show the command in the password prompt?

Is it possible to have the sudo prompt to also show the command? the simple [SUDO] password is fine if you were the one to invoke it. But often you run a script and would like to double check what you ...
user avatar
0 votes
0 answers
19 views

cannot use sudo on company issued mac - workarounds?

I cannot use root/sudo on my Macbook - is there a way to create some sort of artificial root user, so that the sudo command, when issued by tools and software on my machine, can not break stuff?
user avatar
1 vote
1 answer
44 views

Accidentally changed owner of `/etc/sudoers` to non root. Can't sudo or revert

On Raspbian, tried to change permission for /etc/sudoers.d/octoprint-shutdown to pi user to edit the file and it worked but now I can't sudo anything. The command I used to break it: pkexec chown pi:...
user avatar
  • 123
1 vote
2 answers
45 views

Unable to get sudo to work in script when using cron

Environment: RHEL7.9 Access: No root access. I have sudo access to some commands (no password) Issue: my personal crontab calls a script with sudo, sudo isn't working. I have a script.sh that calls ...
user avatar
  • 188
0 votes
1 answer
18 views

Downloaded software wont launch itself and has to be opened with existing application (Xarchiver)

I tried downloading the software Blender, usually i just double click what i open and it launches easy-peasy but when i try to launch Blender i have to pick an existing application to open it with (...
user avatar
  • 1
1 vote
1 answer
16 views

sudo eats up commands pasted via putty. Why?

When I paste multiple commands into putty window, commands stop executing after first sudo. Why? My clipboard (I'm careful to copy also newline after the 2nd command) sudo -u smith echo aaaaaaaa ; ...
user avatar
1 vote
1 answer
34 views

using fastboot to flash an image on Windows remains stuck on < waiting for any device >

I have a Linux based MCU device that's connected using USB into which I'm flashing a boot or system image using fastboot. On an ubuntu host machine, I use fastboot with root permissions via sudo adb ...
user avatar
  • 11
1 vote
0 answers
47 views

Run script with root permission as normal user

Problem: How can I run a script owned by root with root permission as normal user? Let's take for example a folder /path/to/folder. First I make sure that the folder and all content is owned by root: ...
user avatar
0 votes
1 answer
34 views

how to call bash function on login as root user

I'm using Arch (with Xfce) and need to run a bash function when I log in to my OS. The function that I wrote, needs to be run by root access. This is the function: my_func() { sudo -v sudo chown ...
user avatar
  • 101
0 votes
0 answers
19 views

How to run compgen using sudo?

There is some product on Go that uses bash autocomplete (command[TAB]) Autocompletion of commands works correctly under both a regular user and a super user. However, if we try to use autocompletion ...
user avatar
0 votes
1 answer
50 views

Append a line to the end of the file using ssh, sudo and sed

I have an obvious problem with quoting in bash such that I couldn't really solve for a while. Here is a loop with executing a remote command in a sudo-subshell on a remote server via ssh: for HOST in $...
user avatar
  • 172
1 vote
1 answer
404 views

Ubuntu 20.04: sudo apt-get update command error

I ran the sudo apt-get update command and I keep getting this output: Hit:1 http://za.archive.ubuntu.com/ubuntu focal InRelease Ign:2 http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu focal InRelease ...
user avatar
0 votes
0 answers
21 views

Whitelisting approach for linux commands

I recently made a post about how to limit/restrict user commands in the linux shell Limiting sudo access However, a successful solution wasn't found, and I realized I might have phrased my problem in ...
user avatar
0 votes
0 answers
75 views

Limiting Sudo Access

I have been trying to limit sudo access so that the sudo-group only has access to certain commands. This is to ensure that only corporate matters are carried out through the terminal. To obtain this, ...
user avatar
0 votes
0 answers
20 views

How to add ordinary user to sudoers and run commands without password requirement or writing sudo on every command?

Actually I added following line in /etc/sudoers.d/user file, but doesn't work for me user ALL=(ALL) NOPASSWD: ALL
user avatar
0 votes
0 answers
28 views

Allow execution of shell script as different user from sudoers

User A (no general sudo permission given) shall execute a bash script as user B. One minimal script could look like this: #!/usr/bin/env bash touch /home/userB/testfile This script belongs to user A ...
user avatar
  • 111
0 votes
1 answer
22 views

Terminal on Mac not providing responses using various PID related commands

When I try and find the PID of a port using a command such as any of the following (where xxxx is the port number): lsof -i tcp:xxxx netstat -vanp --tcp | grep xxxx sudo lsof -i -P | grep LISTEN | ...
user avatar
0 votes
0 answers
20 views

Any way to see key codes on linux without sudo

I have a managed computer (Ubuntu 18) and my sudo is limited. I want to do some key mapping for my keyboard, but I can't figure out what the key code is for the specific button. The keyboard is a ...
user avatar
  • 101
1 vote
1 answer
880 views

ping: socket: Operation not permitted Ubuntu docker image

Hi i am new to docker and linux. I am trying to ping a particular ip address from a python file in a container built on ubuntu 18.04 base. I get the following error when the kubernetes pod container ...
user avatar
  • 11
0 votes
0 answers
14 views

Connect from container to host and execute commands with sudo in a secure manner

I am able to ssh from a container to the host (after adding the container's public key into the host's authorized_keys file) and execute commands as user but need to supply the sudo password in plain ...
user avatar
  • 243
0 votes
0 answers
35 views

Using GPG from another user (GNU/Linux)

I want to use gpg from another user (user2), so that the primary user (user1) does not have access to the encrypted file, but only to the part the script will output. Added a sudo rule for user1 to ...
user avatar
  • 101
0 votes
1 answer
32 views

how to get to 'username' from 'username@server' on ubuntu terminal?

My terminal on ubuntu 20.04 looks like: I don't know what is @server after the username, but I guess it is a leftover from an earlier now meaningless installation of something. My question is how to ...
user avatar
1 vote
1 answer
163 views

Permission denied on /dev/stderr after sudo

I use this command regularly to switch between users in my development VM: ✸ sudo su - otheruser However I run into trouble if I try to access /dev/stderr or similar: otheruser$ echo hi > /dev/...
user avatar
0 votes
0 answers
122 views

permission denied error cloning git repositry with npm on LinuxLite

I am using LinuxLite V5 and I am trying to clone one repository from git using npm V8.3.0 but it throws this exception: fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-...
user avatar
0 votes
1 answer
74 views

Why is root in sudoers file?

I couldn't help but notice the line in the sudoers file: root ALL=(ALL:ALL) ALL From what I understand root already has superuser privileges and doesn't really need to use sudo at all. Am I missing ...
user avatar
0 votes
1 answer
88 views

sudo to allow apt-get install of remote packages, but forbidding arbitrary commands

I'm looking for a way to allow a user to install (only remote) packages via apt-get (or another mechanism?) but not allow them to run arbitrary commands as root. I can get some of the way there via /...
user avatar
0 votes
1 answer
129 views

Can’t use sudo after umount —all

I tried to unmount all of my fstab mounts by using: sudo umount --all Right after that i tried to remount everything by using: sudo mount -a But got this error: sudo: effective uid is not 0, is /...
user avatar
0 votes
0 answers
22 views

Cannot enter password correctly on Gnome 41.2 in terminal after typing something on number pad

I don't even know how to properly put it in words. When I accidentally enter my sudo password, when something requests it in the terminal with the number pad, which is deactivated, I cannot enter the ...
user avatar
  • 508
1 vote
1 answer
107 views

Can I get sudo privilege while using vim? [duplicate]

So this happened a lot to me. I try to write a file that needs sudo privilege, but I didn't add sudo beforehand. For example, this time, the file is located in /Library/Google/Chrome/...
user avatar
  • 399
0 votes
1 answer
109 views

sudo can't write to temp file

I'm trying to understand why sudo doesn't have permission here touch fred.txt /tmp$ ls -la fred.txt -rw-rw-r-- 1 me me 0 Dec 12 15:40 fred.txt /tmp$ sudo -i ~# cd /tmp /tmp# echo hi >> fred.txt -...
user avatar
0 votes
1 answer
76 views

Why Fedora is not asking for root password when using sudo su?

I need your help, I've set a root password using the command sudo passwd root It says that the password has been set. But when I exit root user and execute the command sudo su It doesn't ask for the ...
user avatar
  • 101
0 votes
0 answers
2k views

SUDO - Error with sudoers_audit plugin

I have one problem with sudo. When I run sudo in regular account I get: sudo: PERM_ROOT: setresuid(0, -1, -1): Permission denied sudo: error initializing audit plugin sudoers_audit But I commented ...
user avatar
0 votes
0 answers
75 views

Mac: Can I replace blank sudoers file with sudoers-orig?

I use an iMac running High Sierra 10.13.6 Premise: I've never used Terminal before, and up until last week I never had the need to either open it. So I apologize if I could ask obvious question and/or ...
user avatar
  • 1
0 votes
2 answers
573 views

Why can't I use the sudo command with this user?

I am not a system engineer (I am more a software developer). I have the following problem trying to deploy an application on a Linux Centos system. As the first operation, I need to install Java and ...
user avatar
  • 6,539
0 votes
1 answer
1k views

How do I get to root on pfSense?

I am running pfSense 21.05.2 in AWS. I can ssh in as ec2-user, and I can see that the sudo package (0.3_6 with a dependency on sudo-1.9.7) came pre-installed. In the web interface, under System > ...
user avatar
0 votes
0 answers
198 views

SSH key authentication installed on DSM 7, now sudo is refused

My Synology is upgraded to DSM 7 somewhere in june and I was running openHAB on it. All broke down so I have to rebuild my complete openHAB environment. To help me out I updated my connection to the ...
user avatar
0 votes
0 answers
19 views

Sudo password incorrect after connecting to office VPN on Macbook pro

I have a Macbook pro given by my company and I use an office VPN to access company internal files. When I do sudo in my terminal when connected to the VPN, it shows invalid password. It starts to ...
user avatar
  • 1
0 votes
1 answer
39 views

How to change default permission of file

I have 2 Debian machines. ======== Debain Machine 1=========== $ sudo install -m 0755 -d folder/kumar $ echo "something" | sudo tee -a folder/dict/file something $ ls -lcrt folder/dict/ ...
user avatar
0 votes
1 answer
141 views

Why does it take so long to execute commands with sudo?

I have a VM running Kali Linux 2021.3. I have only 2 users kali and root. The kali user possesses sudo permissions with a password. When I run a command without sudo permission, it executes fine. But ...
user avatar
0 votes
0 answers
275 views

Windows 11, WSL with Ubuntu 20.04.3 LTS: cannot perform "sudo apt install build-essential" because of missing dependencies

I need to install Salome-Meca - Code_Aster on a Windows 11 machine running Ubuntu 20.04.3 LTS inside WSL. This software requires a series of extra modules (see https://www.code-aster.org/V2/spip.php?...
user avatar
  • 1
0 votes
0 answers
29 views

macos terminal with sudo cannot find hidden file

Im executing the command in mac terminal sudo /Users/username/someFolder/programForMacOs programForMacOs runs and looks for a file in the same directory its running from (/Users/username/someFolder/) ...
user avatar
0 votes
0 answers
32 views

Run sudo su and tcsh from a script to change the terminal

Whenever I putty into one of our Linux VMs, I run: sudo su - serviceid tcsh bindkey -k up history-search-backward bindkey -k down history-search-forward The serviceid changes depending on what server ...
user avatar
0 votes
0 answers
64 views

unable to install ibm_db_sa because of permission issues

I am trying to install ibm_db_sa inside my miniconda virtual environment (Python 3.6). I get this error probably because I am a separate user on my laptop and not the admin. Is there any solution/...
user avatar
  • 117
0 votes
1 answer
52 views

sudo prompts for password even though suders entry specifies NOPASSWD

I'm trying to give a specific user the ability to run two commands w/ sudo, without prompting for a password. This is what I did: # temporarily grant privs to nitsadmin Cmnd_Alias REBOOT = /usr/sbin/...
user avatar
1 vote
1 answer
90 views

du command not counting some subdirectories

Calling: sudo du -sh /var returns: 0B /var but calling: sudo du -sh /var/log returns: 613M /var/log Why is du not counting subdirectory despite sudo? Also some items gave Operation not permitted ...
user avatar
  • 131
3 votes
1 answer
311 views

Why to authenticate?

For starting gdm I am using this command sudo systemctl start gdm.service When I am executing this command directly on the shell, then I am presented with the [sudo] password for username: Thats ...
user avatar
1 vote
1 answer
27 views

Modify sudoers to bypass password requirements but it's not taking effect

I need to run a script with sudo without entering my password. I'm editing /etc/sudoers (using sudo visudo) and on the last line, I'm adding: MY-USER-NAME ALL=(ALL) NOPASSWD:ALL I just want to make ...
user avatar
  • 15
0 votes
0 answers
53 views

Pass argument to script for sudo and su in script

I need to provide for my devs the possibility to run 'php artisan' with different arguments and all of it should be done by Jenkins job. We have a jenkins agent (running with 'jenkins' user) on our ...
user avatar
2 votes
1 answer
152 views

How to regain sudo permissions?

I'm using WSL1 and at some point I did something that means I can no longer use the 'sudo' command at all (unfortunately, I can't remember what I did or when that caused this issue but it definitely ...
user avatar
0 votes
0 answers
24 views

After sudo upgrade , running Sudo -V errors out ksh: sudo: cannot execute

Installed sudo package 1.9.7p1 installation completed successfully however when I run sudo -V ksh: sudo: cannot execute Server is running solaris 10
user avatar

1
2 3 4 5
22