sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
0answers
20 views

How do I escalate a signal?

For the past week, I been having a bug that my python code hasn't been doing a cleanup process properly. It was suppose to once it captures a signal caused by closing the terminal, it does some ...
0
votes
1answer
185 views

Valid root/user passwords not working on EC2

There is an authentication failure when I'm trying to enter password for any of my accounts after an update using yum. My authentication got broken, while everything else works. The updates were ...
0
votes
2answers
83 views

Automatically rerun something with sudo if root needed [duplicate]

I'm running Arch Linux in a virtual machine and it's getting REALLY annoying that since some thing require that I cannot be root, I need to sudo most of my commands. It would be nice if I could do ...
4
votes
1answer
153 views

Load aliases from .bashrc file while using sudo

I have set aliases for a few programs in the .bashrc file, and they work fine without sudo and they don't with sudo. Is there a way to get those aliases work with sudo? For example: nano text.txt ...
2
votes
1answer
45 views

lost ability to sudo after modifying pam module

On one of our RHEL6 servers I made a change to /etc/pam/d/system-auth and password-auth then after rebooting lost the ability to sudo and su. Specifically I changed this line: auth sufficient ...
1
vote
0answers
24 views

No drivers after usr ownership change Linux Mint

I have Linux Mint 14.2 installed on an IBM T60 ThinkPad. Everything was going just fine until I was installing some developer tool (I can't even remember which one anymore) and accidentally changed ...
2
votes
0answers
245 views

No candidate version found for sudo

When I tried to install sudo in Debian 8.2 via aptitude install sudo I got an error: No candidate version found for sudo. The source list is standart. Here is the Source list: deb ...
1
vote
1answer
218 views

Change ownership of file from a user to another user which the first user controlls

I already know I cannot use chown willi-nilly as a normal user however in my situation I have two users: user1 and user2 where user1 is allowed, by the Sudoers file, to sudo in as user2. Is it still ...
3
votes
1answer
48 views

How to ensure proper file permissions when running installer bash as sudo?

I am making a installer bash, playing with it a little too. But I just came across a serious problem: As I run the bash with sudo ./install.sh, all the files it copies are owned by root and therefore ...
3
votes
1answer
61 views

How many check points in RHEL/CentOS to make sure no one have sudo/root access

I want to make sure no one has sudo access or root access on some production servers. Some points I have also verified like: grep 'x:0:' /etc/passwd grep root /etc/group cat /etc/sudoers key in ...
7
votes
2answers
242 views

How to prevent the caller's shell from being used in sudo

I'm running sudo-1.8.6 on CentOS 6.5. My question is very simple: How do I prevent SHELL from propagating from a user's environment to a sudo environment? Usually people are going the other way- they ...
2
votes
2answers
229 views

How to gain sudo access after powerwashing (factory resetting) my computer?

I just powerwashed (that's a factory reset on chromebooks) my computer so that it would be be 'brand new,' however now I don't have sudo access anymore. I used to not need a password to use sudo, ...
1
vote
1answer
36 views

Make superuser act like some other user in certain directory tree

I have the following problem: My home directory lies on the network and is mounted locally on home/<my username>. I can access it with my normal user account <my username>, but as root, I ...
1
vote
1answer
102 views

Sudo directive to read a log file

This works: apache ALL=(ALL) NOPASSWD:ALL but this does not: apache ALL=(ALL) NOPASSWD:/var/log/maillog It says: "sudo: no tty present and no askpass program specified." The path is correct. Am ...
0
votes
2answers
129 views

Run script as admin (prompt for password) from xfce GUI

I have a mount script I need to run as admin. Since nobody knows how to run it automatically, I want to at least reduce the pain of manual start. The script has one line: sudo mount ... more params ...
3
votes
3answers
129 views

How can I run a program as another user in every way?

Background I'm trying to restart some programs (mail-notification and stalonetray) regularly, as they appear to die frequently. I want to set restart them whenever NetworkManager reconnects. Hence, I ...
0
votes
2answers
1k views

Run bash script with sudo, some commands as normal user

I have the below script, it is meant to be run with sudo however the first to commands (The git commands) need to run as the user "ubuntu" sudo -u ubuntu "git -C linux/build-repo pull" sudo -u ubuntu ...
3
votes
1answer
137 views

How to use grep with files in arbitrary encoding, without locale installed and without sudo?

I have utf-8 locale on my computer, and i want to search in KOI8-R encoded files. But i don't have KOI8-R locale installed. And i don't have sudo rights to install this locale. Is it possible to ...
1
vote
2answers
215 views

weird same output when using sudo command [ lp_bool(yesm): value is not boolean! ] [closed]

Whenever I am using sudo (followed by other command) I am getting same error again and again, here it is: lp_bool(yesm): value is not boolean! for example, sudo <some command> ...
0
votes
0answers
43 views

Are there behavior changes for sudo-1.8.6p3-15.x86_64 (RHEL6.6) as compared to sudo-1.6.9p17-6?

We found that there is a behavioural changes in sudo-1.8.6p3-15.x86_64 (RHEL6.6) as compared to sudo-1.6.9p17-6 (RHEL 5.8). It has been observed if a script called through sudo, and if CtrlC (SIGINT) ...
0
votes
1answer
43 views

Why can't I create directories under /root as a member of root? [duplicate]

I've done the following: sudo usermod -a -G root userA sudo su - root cd / chmod 775 root ls -aln -- drwxrwxr-x. 6 0 0 4096 Sep 13 22:04 root I can cd /root from my userA, but I can't make ...
1
vote
2answers
112 views

SSH to servers with sudo access - script throws unexpected end of file error

I've to run a command iptables --flush in 100+ servers. I don't have root credentials, but have sudo access for my account. So I come up with a below script to run the command in all servers. I added ...
1
vote
1answer
30 views

enable a user to chroot?

I have a script that I am running as a regular user (but one that can sudo). This script relates to BIND and gathers information each time it runs. It has not been working correctly and I noticed ...
2
votes
2answers
66 views

Run and stop a monitoring command as sudo for s seconds every m minutes

I want to run sudo airodump-ng -w myfile every ten minutes or so, for m minutes. It does not matter if the running time shifts (that it, if it runs m minutes later each time). Notice that this is a ...
3
votes
1answer
130 views

sudo script - best practice?

I have a script in which some of the commands need to be run as sudo. I have seen it asserted that running sudo inside scripts is a bad idea, and that is is better to run the whole script as sudo (and ...
3
votes
1answer
159 views

Can't give myself NOPASSWD privelege for chmod/chown [duplicate]

I'm trying to set my local computer (which has Linux Mint 13 Maya) so that I can chmod & chown any file with my regular max user account. Following this page, ...
0
votes
3answers
174 views

First bash script - Enter root password only once

I wrote a small bash script. But it needs root password. There are two commands only, both of which need the permission. So, currently I must enter sudo password twice - I don't want that. I linked ...
3
votes
1answer
275 views

How to make a sudo passwordless script for any user in bash

I want to be able to run a sudo command inside of a bash script but I was wondering what if I want any user in my server to be able to execute the script without to provide them with my root password, ...
5
votes
0answers
187 views

allow regular users to use network namespaces

I have an architecture using network namespaces (netns). I would like to allow regular users to do some operations in these netns. I could write a script netns-exec.sh, inspired by this post, ...
6
votes
1answer
300 views

What permissions one needs to run chmod, chown command on a folder/item?

I've always been running chmod/chown commands as a sudo user. But today I wondered if I don't use sudo, what permissions do I need to actually execute chmod/chown command on a folder/file? I've tried ...
0
votes
1answer
88 views

Is it possible to execute a command as another user without sudo su'ing to that user?

I do a lot of administration in CentOS6 for several teams. One of the more frequent things I do is sync down and package code as the team account, before deploying it out under my own account. Is ...
2
votes
3answers
1k views

sudo command doesn't source /root/.bashrc

I have added a custom path to PATH variable in my /root/.bashrc file When i do sudo su; echo $PATH, it shows the entry, '/path/to/custom/bins'. But i do sudo sh -c 'echo $PATH', it shows, ...
0
votes
1answer
135 views

Sudo Apache, with command line ? (not visudo)

I have visudo-edited /etc/sudoers this way: User_Alias APACHE = www-data Cmnd_Alias FIREWALL = /sbin/iptables, /sbin/ifconfig, /sbin/route APACHE ALL = (ALL) NOPASSWD: FIREWALL (To allow php ...
0
votes
1answer
145 views

Linux Sudo Without Password Prompt [duplicate]

I want to run a bash command at startup (~/.config/autostart/myCommand.desktop) that requires sudo, but rather than it prompting me every time, I would like to include the password in the command, ...
1
vote
1answer
310 views

Eclipse does not launch without sudo

On my Fedora (Fedora 22 Workstation) system, I recently installed Eclipse (sudo dnf install eclipse-platform). However, I am unable to launch Eclipse without using sudo. I would prefer not to have to ...
3
votes
2answers
56 views

What is the problem of giving the right to use sudo vim? [closed]

I'm using Mac OX 10.10. I would like to know what problems are caused by this: user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf I think this is in /etc/sudoers. I also have Cent OS. Does this ...
2
votes
1answer
277 views

ldd shows library exists and is linked, program doesn't find it

Console Output: bitnami@linux:~$ sudo svnmucc propset svn:needs-lock 1 file:///opt/bitnami/repositories/Standard/Ipc/trunk -m "test set" svnmucc: error while loading shared libraries: ...
3
votes
2answers
107 views

Why user without any PASSWD entry in sudo config has to authenticate every time?

Consider this sudo config for two users: mary ALL = (ALL) NOPASSWD: /bin/ls, /bin/cat bob ALL = (ALL) PASSWD: /bin/sort Now, when user mary executes any command not in the list she has to ...
1
vote
4answers
133 views

What's the difference between sudo su vs just su?

I see a lot of posts out there that say you type in sudo su to get an interactive prompt with root privileges, and I see equally many posts debating the pros and cons over sudo -i vs sudo su. Here ...
0
votes
1answer
132 views

ssh master - execute su remotely

I have a server S that I need to connect to. I'm connecting to S as user asdf with control master and after that I perform some stuff: ssh -N -f -M -o ControlPath=$SSHSOCKET ${USER}@${IP} -p ${PORT} ...
-1
votes
2answers
276 views

When in debian 8.1 why is the super user run with su not sudo? [closed]

I am curious why the super user command su is run and not super user do (sudo).
1
vote
2answers
846 views

error when adding user to wheel group in CentOS 7

I am trying to grant sudo privileges to a user of a CentOS 7 devbox by typing gpasswd -a user wheel, but the attempt is failing. What am I doing wrong? Here is what I typed: I discovered that ...
2
votes
1answer
377 views

Why root bash output is colored but `sudo ls` output is not?

In bash (I am using Ubuntu 12.04) I get colored outputs either as root (after sudo su) or as a normal user. I checked (after reading this post) the files .bashrc for normal user and superuser and ...
3
votes
2answers
1k views

How to stop sudo PAM messages in auth.log for a specific user?

I am using Zabbix for monitoring my environment and zabbix_agentd executes as user zabbix one custom script every 60 seconds; it uses sudo to run this script as root. In /var/log/auth.log I see every ...
0
votes
0answers
26 views

debian 7 sudo email notification

I edit sudoers by visudo: Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Defaults mailto = "me@domain.com" Defaults ...
1
vote
2answers
320 views

run command with sudo su in script and redirect stdin and stdout

I need to run command as another user and write to its stdin and read from its stdout. I can run command as another user only via opening new shell: sudo su anotheruser but with new opened shell i ...
2
votes
1answer
59 views

make sudoers use their own history file

I just can't seem to get a simple answer to this one. All I am trying to do is get a sudoers to use their own history file, but if I set the history var in the .bashrc for root with $user, the $user ...
0
votes
2answers
162 views

Disable some programs from sudo

I have a group of trusted developers which I have given sudo permissions on a server but I want to be able to exclude some programs to be run with sudo. For example I would like to disable command su ...
1
vote
1answer
173 views

How do you sudo with xonsh?

I get the error xonsh: subprocess mode: permission denied: sudo.
0
votes
2answers
64 views

sudo host field: what is it used for?

syntax for sudo is user ALL=(ALL) ALL whereby: 1st field is the user that can execute sudo 3rd field is the users that can be sudo into 4th field is the commands that can be executed as ...