sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
1answer
26 views

mount permission mechanism for file explorers [duplicate]

When I execute a script that uses the "mount" command, I need to enter my sudo password. However, I can launch a file explorer like nautilus and mount a filesystem from that application, without ever ...
1
vote
1answer
331 views

sed and sudo with string replace

I want to replace a string with sed and save changes to same file which needs sudo as its a root owned file. But while doing that I am getting below error raja@raja-UbuntuVM:~$ sudo sed 's|gateway ...
3
votes
3answers
120 views

How to set a password that violates password constraints without changing constraints using sudo

I have root access on a machine shared by others. I think the password constraints are absurd, they are overly excessive in how they mandate the use and ordering of non word characters and make ...
2
votes
1answer
334 views

Read from /dev/input devices without root privileges

Is there a way to read from /dev/input devices, without needing root privileges? In my case, I would like to use the Python library evdev to read from multiple keyboards (so that I know which ...
0
votes
0answers
137 views

Escape special characters in password on remote machine

I'm trying to run sudo -i on the remote machine and send password in the same line. Faced with the problem of when the password contains special characters; escaping does not help. I would be glad ...
1
vote
2answers
193 views

reset system file permissions, owners and groups

Mac has a utility that checks permissions of files installed on your system to make sure they have the correct permissions as per an installation. Is there something like that with LinuxMint. I am not ...
0
votes
1answer
49 views

What is the difference between Runas_List and User_List in sudoers file on Linux

I have gone through the man page and it states the following: A Runas_List is similar to a User_List except that instead of User_Aliases it can contain Runas_Aliases Looking at the definition of ...
1
vote
1answer
179 views

want to su without password inside shell script

I have written a script which will run a script for a backup before: # cat backup-before-shutdown #Scritp to take backup before shutdown #Author Ashish Karpe echo "Taking backup to s3" su ubuntu /...
2
votes
3answers
79 views

Change files with Editor that need sudo permissions

I want to change files with KomodoEdit, that need sudo permissions. I cant start KomodoEdit with sudo tho (for whatever reason). Can I somehow grant Komodo permission to edit those files (in ...
0
votes
1answer
118 views

How do I modify contents of a directory without sudo?

I'm trying to modify the contents of a directory using git. Problem is if I use sudo it nullifies my ssh forwardAgent. I'm not the owner of the directory but I am part of it's group. If I chmod 775 ...
0
votes
3answers
2k views

sudo: “effective uid is not 0, is sudo installed setuid root?” on a Raspberry Pi

I have been using a Raspberry Pi for a few weeks and put a lot of hours into configuring everything for my university project. I wanted to install Samba and have everything as a network folder. I ...
1
vote
2answers
330 views

Enable user to execute one command as another user

The goal is to let the www-data user execute sudo -u postgres -H osm2pgsql [some options here] without being asked for a password (as this will be part of a script wich runs automatically). I thought ...
0
votes
0answers
15 views

Alias not working with sudo [duplicate]

I have made a alias to view the log of my OpenVPN: luis@Terminus:~$ cat .bashrc | grep "vpn" -i # Alias para OpenVPN: alias ConectadosOpenVPN="cat /etc/openvpn/openvpn-status.log" But it must be ...
1
vote
2answers
226 views

How can a script run privileged commands on a remote system without sudo or ssh passwords?

I'm looking to set up my sudoers file correctly, but the documentation I've found doesn't seem to help. I have a user, e.g. user1 I have two Debian servers, server1 and server2. At present I can ...
1
vote
2answers
116 views

how to remotely execute a shell script with elevated privileges

I have two servers, serverA and serverB. At present I run a shell script on serverA that creates a file and 'pushes' it to serverB. The shell script runs as a cron every hour and requires SUDO ...
0
votes
1answer
41 views

Can Webmin run as sudoer instead of root? [closed]

Have someone some experience with using xinetd with a user which is not root, but instead a sudoer? The operations that are required to be done do not always requires admin priviledges : ex ...
1
vote
1answer
205 views

Restart PHP-FPM from a PHP script

I am running a LEMP stack and wish to write a simple control panel for it. So, I want to be able to restart php-fpm from a php script. To achieve this, this is what I did. Created a binary wrapper ...
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
2k 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
69 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
292 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
105 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
38 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
23 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
227 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
97 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
194 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
283 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
310 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
56 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
62 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
308 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
299 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
39 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
151 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
187 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
184 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
2k 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
201 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
273 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
158 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
33 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
77 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
148 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
205 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/...