Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
34 views

How to edit protected files on mac

I've just bought a new mac, I'm trying to edit the DockMenus.plist file from Dock.app to remove finder from dock like I've done with my previous macs. However, on saving, vim prompts this error: "...
1
vote
1answer
18 views

re-requiring sudo prompt for a password?

By default sudo seems to cache passwords for like 5 or so minutes. ie. You do sudo something once and you're prompted for the password and then any subsequent sudo command you do for 5 minutes doesn't ...
0
votes
0answers
13 views

Sudo sshuttle -r -x

Sshuttle can direct all you local internet traffic through SSH, like a poor man VPN. sshuttle -r root@11.54.78.145 0/0 --dns -x 11.54.78.145 Then it asks for local root password. Can I put sudo ...
0
votes
2answers
56 views

Command found only when used with `sudo` in terminal

I am on debian 9. There are some commands that cannot be found when I don't type sudo right before. Can I disable this feature? I have Arch Linux and it does not have this security feature. My user ...
0
votes
2answers
64 views

One-liner capturing output for sudo kill

Background I have some root processes that I'm trying to kill, more precisely some tcpdump processes. Hence, I need to use sudo kill. My current command looks something like this: sudo kill $(ps ...
1
vote
1answer
20 views

Accidentally added a character outside of a comment in sudo file on Mac, sudo not working any more

I made a mistake in terminal, and now every time I use sudo, I get the error message: sudo: unable to initialize PAM: Invalid argument I know what I messed up, which is adding a character outside of ...
0
votes
2answers
47 views

Error when ssh to remote server when using sudo user

Trying to do ssh to remote machine over sudo user and getting error but doing ssh thru my normal user getting connection error. Here is the detail process. case_1 - ssh by Normal User - Working fine ...
1
vote
1answer
30 views

Bash double brackets [[ with sudo

I've got a command that is working when run as the current user but if I prefix sudo to the command, it gives me an error. I'm trying to remove a file if it's a directory (but not if it's a symlink ...
1
vote
0answers
50 views

dpkg: unrecoverable fatal error, aborting: read error in '/var/lib/dpkg/diversions': Is a directory

While upgrading using sudo apt-get upgrade or any installation, an error appears as : dpkg: unrecoverable fatal error, aborting: read error in '/var/lib/dpkg/diversions': Is a directory I made a ...
1
vote
1answer
33 views

Plink does not work with commands file for git in sudo

I use plink.exe for automatisation of git commands and this works fine. But i need to use this with servers with login of sudo plink.exe -ssh argentium@186.118.154.164 -m commands.txt my commands....
1
vote
1answer
24 views

Root user to execute a script without privilege but allow sudo commands to run without password

So as root (in /etc/rc.local) I want to run a script without root privileges say using su su - myuser -c myscript but in the myscript I want to run a command with sudo without giving a password. ...
1
vote
0answers
39 views

Error installing Sudo on Debian

I'm trying to install sudo on Debian. At first I logged as root and then apt-get install sudo when I open nano /etc/sudoers it is an empty file. Here is a screenshot of my apt-get install sudo. Does ...
0
votes
0answers
33 views

sudo/pkexec vs sandbox: Differences & Pros/Cons

I am looking at running Jitsi on Debian. For security reasons, I want to isolate Jitsi from the rest of the system. I could use a VM, but I want a lighter solution. So I looked at sudo/pkexec vs. ...
0
votes
0answers
63 views

Plink sudo rootsh send password

I want to automate some tasks on a server and i'm having some issue with sending the password for sudo. Scenario: linux server can ssh with local user ( I can send this user's password via plink) ...
1
vote
1answer
14 views

windows network drive linux mount requires sudo after mounted

I am able to mount a drive to the linux box using sudo. sudo mount \ -t cifs \ -o 'vers=3.0,username=myuser,domain=mydomain' \ '//windows-ip/share-folder' ~/testmount/ This works great, ...
0
votes
2answers
37 views

Reenable Google Chrome updates on Mac

i was wondering if any of you guys is able to help me reenable Google Chrome updates ? Please note that i have no programming knowledge of any kind and i am a total noob. A friend of mine ran the ...
0
votes
0answers
36 views

sudoers: can´t run 2 command lists where the second has a glob * and denies the first

so, what I want is: to be able to run /sbin/print/managequeue.sh -p app1 --view as another user without asking password. to be able to run /sbin/print/managequeue.sh -p app1 --cancel (or --delete, ...
0
votes
1answer
55 views

Using git command without sudo on CentOS [closed]

I would like to use git without taping sudo everytime i tape a command on CentOS and i have no idea how to do it. I checked on google and i found this some command with chown but none of them worked ...
1
vote
1answer
188 views

How to send sudo password in a shell script

My shell script (don't have EXPECT, and is not possible) runs a shell script impersonating another user. Let's say the following script is named toto1.sh and is run with a user called MYUSERNAME1. #!/...
0
votes
1answer
202 views

sudo su with password provided in jenkins?

I am stuck with one requirement in which I am switching to some "xxx" user and it asks for password every time. I am trying to automate this process with password hardcoded in Jenkins job. ex: sudo su ...
0
votes
0answers
36 views

Sudoers Argument Parsing using Python

I am working on a project and I need to be able to limit the command line arguments for commands when they are called with sudo. The parsing we are doing is big enough that using glob would be painful,...
0
votes
0answers
39 views

Locked out while setting up nginx

It's my first time trying to setup a web server. I was trying to set up a Digital Ocean Droplet running CentOS. During nginx setup, I 'accidentally' changed the permission of '/' to the nginx user, ...
0
votes
1answer
87 views

Debain(buster) su not working properly, command not found

For example: I installed ifconfig First i become root with "su" Now I write "ifconfig" and get: "command not found". I write "sudo ifconfig" and now it works. This seems to happen with a lot of ...
0
votes
1answer
55 views

How do I create a window as sudo from .screenrc

I have created a .screenrc file to automatically setup my various windows when I run screen. In one window I'd like to: switch to the root user, then change to a certain directory. I currently do this ...
0
votes
3answers
263 views

How to provide password directly to the sudo su -<someuser> in shell scripting

I got a requirement to automate in shell script for sudo su -<someuser> which asks for password. How to provide password directly to the sudo su - in shell scripting for IBM AIX servers. I have ...
2
votes
2answers
45 views

Setting LD_LIBRARY_PATH to point to a backup of sudo does not work

I've accidentally removed the contents of the /usr folder, but I have a backup of it in /mnt/usr. To fix it I need sudo, but it was in /usr/bin. So I tried to use /mnt/usr/bin/sudo, but it throws a ...
0
votes
2answers
85 views

Execute a script as root when non root user logs in

I've seen this question asked before here and here but they're pretty old and I haven't been able to get any solution to work. Basically I need to run a script or command automatically as root each ...
0
votes
1answer
127 views

I forgot my sudo password

I forgot my sudo password. I want to install a package and it needs me my sudo password. Every time I enter the password by chance. I get the error of try again. Would you please tell me how I can ...
0
votes
0answers
42 views

Su/sudo not working consistently

I am running Debian on a Lenovo x220 and upgrade my packages quite regularly. I discovered recently a change in the way how I elevate with sudo. Normally I just su or sudo stuff like e.g. arp-scan -l. ...
1
vote
1answer
393 views

sudo access a file without sudo password

I have a lab which requires me to use sudo to access a protected file and obtain its content. linux@sudo:~$ sudo -l Matching Defaults entries for linux on sudo: env_reset, mail_badpass, ...
0
votes
0answers
34 views

How can I get yum to work without root?

If I make all folder in the root directory world writable, something like: sudo chown 777 -R / Would this enable yum to work without root privileges? If not, is there a way similar to this to make ...
0
votes
1answer
75 views

CentOS 7 Apache run/execute web request as root user

I have a PHP Utility which accepts post request with file as parameter. Now when that request is received I want to execute it as root user. For example when user hits www.mydomain.com/...
0
votes
1answer
237 views

How to avoid “root is not allowed to run sudo”?

I am trying to execute some third-party installer script (ansible tower setup.sh) which needs to be started as root or via sudo as some of the commands rely on root privileges. However some commands ...
0
votes
1answer
158 views

Why running kill in linux needs sudo access

On one server(my development desktop), I am able to execute kill command without sudo, but on the other one, I will got kill: kill 1 failed: operation not permitted. I assume that kill command will ...
0
votes
2answers
68 views

Should I add sudo before the fastboot command on macOS just like on Linux?

I will be using fastboot on macOS. I will be following this tutorial. The guide only mentions Windows and Linux, and I do not wish to install those on my Mac right now, and as I think fastboot is the ...
0
votes
1answer
86 views

sudo python vs python

I have an instance in EC2 running Linux. I am trying to use the AWS Python DAX Client. The Dax Client is operating at the TCP level. I am running one of their example sample code https://github.com/...
0
votes
1answer
195 views

SSSD/NSS Slow When Using Sudo

I have a server running OpenLDAP, and the issues I am running into is with my client. My client is running SSSD with NSS. On first boot, I have no issues, and sudo commands are issued fine. I start ...
0
votes
1answer
144 views

Sudo with auth sufficient pam_tid.so does not work with tmux

I did not really like the idea of installing some third-party sudo tool, so instead of using sudo-touchid I decided to use the /etc/pam.d/sudo trick and it works wonders. I use iTerm2 with zsh, and ...
0
votes
0answers
19 views

How to remove sudo dependency for programs installed using bioconda?

I installed a program using conda and pip with sudo privileges because the program requires tons of dependencies which installations are root required. After successfully installed the program, I was ...
1
vote
0answers
53 views

How to debug program creating RAW socket?

For example I have this program: int main() { int sockfd = ::socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); if ( sockfd == -1 ) printf("Error\n"); else printf("Success\n"); return 0; } ...
0
votes
0answers
114 views

How to execute a binary file in Ubuntu?

I would like to execute this binary file: /usr/bin/snx (CheckPoint Security VPN client) When I execute snx or sudo snx from anywnere, the responses are: bash: /usr/bin/snx: No such file or ...
0
votes
1answer
35 views

How do i reverse alias command?

I executed this command : sudo ifconfig lo0 alias 10.200.10.1/24 I think this changes my localhost address and I think my dockers seem to stop working because of this. Is there a way to reverse ...
3
votes
3answers
186 views

stop systemctl using graphical sudo prompt

My question is how could I configure systemd(?) to stop opening this annoying pop-up whenever I forget to type sudo. Just give me a text-based sudo prompt or show an error, so I can correct the ...
5
votes
2answers
2k views

Sudoers NOPASSWD for single executable but allowing others

Operating System: Arch Linux Linux version: 4.16.11 Sudo version: 1.8.23 What I need: be able to execute any executable with a sudo with a password prompt be able to execute one executable, /home/...
0
votes
1answer
71 views

Is there something like a sudoers list in Windows?

In UNIX-like systems, normal users can obtain higher priviledges using the sudo command (or they can temporarily switch the user using su). However, with a properly configured sudoers and PAM file, ...
0
votes
0answers
139 views

Setting sudo rights for an Icinga2 Service

I have icinga2 installed on 3 Servers, all with debian stretch. On one Server I have glusterfs-Server running and would like to monitor it with icinga2. From the icinga2 website I downloaded the ...
0
votes
0answers
184 views

Root user no longer exists

I'm running macOS Server 5.6.1 on High Sierra (10.13.4) and I was trying to modify a system launch daemon plist file the other day as my apache installation wasn't working after migration. sudo wouldn'...
2
votes
2answers
129 views

Locked out of sudo by erroneous PAM config causing PAM bad jump in stack

While trying to mitigate some spammy PAM messages in /var/log/auth.log, following this post, I tried various combinations in /etc/pam.d/sudo. Unfortunately, the last line I tried, completely locked me ...
1
vote
1answer
194 views

sudo minikube returns “command not found”

I need to run minikube as sudo on Centos 7.5. minikube is in /usr/local/bin For my user echo $PATH is: /usr/local/maven/bin:/usr/lib64/qt-3.3/bin:/usr/local/maven/bin:/usr/local/bin:/usr/local/sbin:/...
3
votes
1answer
799 views

“sudo” session behavior in graphical environment

I wrote these two scripts and they are in my $PATH: gsudo: #! /bin/bash sudo -n true &> /dev/null if [ $? -eq 0 ] then sudo "$@" else upass=$(zenity --password --title "Enter your ...