sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
30 views

How can I put a user in the superusers file?

I have just installed the command sudo but when I use it returns that I am not in the sudoers file. What should I do?
2
votes
2answers
1k views

using sudo -u <name> to run commands inside shell scripts

I'm extremely lazy, and prefer to write scripts to automate compiling software. To me, as these scripts can get quite long, it's easier to run them as root but have the individual software compile as ...
0
votes
0answers
65 views

Doesn't these program respect nsswitch?

I've set up LDAP and nsswitch on ubuntu and to some extent it seem to work. For example getent passwd lists accounts from both /etc/passwd and LDAP server. However for example id <user>, sudo -...
2
votes
2answers
271 views

Input password on sudo command

Can I input a password on the sudo command itself? Something like: sudo rm (dir) -p (password) I used sudo help but couldn't find a correct syntax (if there is one)
54
votes
11answers
10k views

Why do I have to use sudo for almost everything?

If I understand the Linux philosophy correctly, sudo should be used sparingly, and most operations should be performed as an under-privileged user. But that doesn't seem to make sense, since I'm ...
1
vote
1answer
99 views

Updating /etc/sudoers file in bash

I am trying to update my sudoers file to preserve the http_proxy environment variable but it keeps getting corrupted The bash script is as follows printf 'Defaults env_keep += "http_proxy ...
1
vote
1answer
36 views

`sudo tar` but own the resulting file

I want to put a bunch of files into an archive with tar. However, I don't have permission to access all of them, so I have to do sudo tar. However, now that root has run the tar, the resulting ...
1
vote
0answers
22 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
213 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
89 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
177 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
46 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
27 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
274 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 http://httpredir....
1
vote
1answer
271 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 ...
4
votes
1answer
55 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
292 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
270 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
38 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
133 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
171 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 ...
4
votes
2answers
161 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
181 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
247 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> lp_bool(yesm)...
0
votes
0answers
49 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
144 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
31 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
75 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
140 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
192 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, http://askubuntu.com/questions/...
0
votes
3answers
198 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
308 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, ...
6
votes
0answers
261 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
358 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
93 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
2k 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, /usr/...
0
votes
1answer
153 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
167 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
357 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
57 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
352 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: libsvn_client-1....
3
votes
2answers
121 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
149 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 I'...
0
votes
1answer
173 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
324 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
1k 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
510 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 ...