sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
38 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
389 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 ...
2
votes
4answers
3k views

Run local scripts on multiple servers using sudo user through a script

I have about 100 remote servers. I want to manage all my servers using one terminal server to update , run commands with sudo privileges. I need to have one main script that takes another test script ...
1
vote
2answers
80 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 ...
5
votes
3answers
8k views

“No protocol specified” when running vim with sudo

Recently I start to get "No protocol specified" when using sudo vim. It's just a warning I guess, because everything was working normally (I can open, edit and save files). The message doesn't appear ...
0
votes
0answers
14 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
3answers
204 views

Fedora: How can I add myself back to sudoers file?

I've accidentally removed myself from sudoers file by doing usermod -G user group without -a, and now I am not in the sudoers group. I've tried doing su - and entering root's password but it says su: ...
9
votes
3answers
6k views

Why do some packages use 'make install' while other use 'sudo make install'

I recently installed LAME encoder on my server to convert wav to mp3 and that worked with './configure, make, make install; I then tried to install OGG encoder and that requires './configure, make, ...
1
vote
2answers
119 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 ...
0
votes
1answer
30 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
2answers
68 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 ...
15
votes
4answers
505 views

What specific vulnerabilities am I creating by disabling the sudo password?

Here are some instructions on how to disable your sudo password. These carry the following warning If you disable the sudo password for your account, you will seriously compromise the security of ...
0
votes
1answer
29 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?
1
vote
1answer
87 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 ...
1
vote
2answers
2k views

Problem executing command as a different user with sudo -u

I have the following problem: When I'm trying to execute ls as user abc with the following command I get an error: xyz@host:~/temp$ sudo -u abc ls [sudo] password for xyz: Sorry, user xyz is not ...
0
votes
0answers
41 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 ...
37
votes
2answers
16k views

su vs sudo -s vs sudo -i vs sudo bash

What is the difference between the following commands: su sudo -s sudo -i sudo bash I know for su I need to know the root password, and for sudo I have to be in the sudoers file, but once executed ...
53
votes
11answers
9k 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 ...
7
votes
3answers
7k views

ulimit PICKLE: “Operation not permitted” and “Command not found”

I'm trying to increase the maximum number of open files for the current user > ulimit -n 1024 I attempt to increase and fail as follows > ulimit -n 4096 bash: ulimit: open files: cannot ...
2
votes
2answers
516 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 ...
5
votes
2answers
30k views

Suddenly, I Can't login with correct password (greeter & tty)

This might be a duplicate of other password related questions but it's somehow eccentric. I have 3 accounts in my Ubuntu 12.10 system (one standard and two administrators). One of the administrator ...
2
votes
2answers
231 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)
3
votes
2answers
304 views

command substitution: /dev/stdin: Permission denied

I want to read the whole stdin into variable. I don't want to spawn new processes. From bash manual: The command substitution $(cat file) can be replaced by the equivalent but faster $(< ...
9
votes
7answers
9k views

How do I suppress dd output?

I have a bash script that creates some file using dd. The problem is dd throws a great amount of output that is going to mess with the output of my script. Searching around I've found a solution: dd ...
1
vote
1answer
61 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 ...
5
votes
1answer
122 views

Running Deamon Involving GPIO on Pi

I have a daemon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the daemon is always running, ...
1
vote
1answer
54 views

Set root password AMI linux

I need to set a password for root on EC2 AMI Linux. I have tried with passwd root but if I log in with ec2-user and run sudo su, I get a root bash without asking for a password.
-1
votes
1answer
77 views

Error while installing wget and unzip

I am trying to install wget and unzip on an Ubuntu machine. But I am facing the issue shown in the screenshot (dependency problems). sudo apt-get install wget unzip
-1
votes
2answers
201 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
0answers
22 views

Is there a way to automatically use sudo whenever I get “Permission denied”? [duplicate]

Is there a way to automatically use sudo whenever I get "Permission denied"? I don't want to become superuser, since I still want to be asked for the password in such cases. I just don't want to ...
1
vote
1answer
33 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
18 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 ...
8
votes
2answers
8k views

sudo: ulimit: command not found [duplicate]

I was using ubuntu 12.04 ,on which I run ulimit -n ,it is showing 1024, I want to increase my open file limit from 1024 to 65535,so I tried the following command: sudo ulimit -n 65535 but i get the ...
1
vote
1answer
127 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
51 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
128 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
39 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 ...
7
votes
2answers
172 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 ...
1
vote
0answers
21 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 ...
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 ...
3
votes
2answers
7k views

How do I create a new file and edit it as root?

I've tried: gksudo gedit /etc/xinetd.d/tftp (this is the path I need). I got an error message: couldn't find the file /etc/xinetd.d/tftp please check that you typed the location correctly and try ...
1
vote
1answer
111 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 ...
1
vote
0answers
142 views

No candidate version found for sudo

When I try install sudo in Debian 8.2 aptitude install sudo I get error: No candidate version found for sudo. Source list is standart. Sorry for my bad english. Source list: deb ...
3
votes
1answer
45 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
3answers
99 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 ...
2
votes
1answer
158 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
33 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
235 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 ...
1
vote
1answer
63 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 ...
5
votes
2answers
18k views

How can I run as another user?

This is the bash code that should be runned. So first it substitutes the user to openproject and than runs all the code su openproject -c "bash -l" cd ~/openproject git checkout Gemfile.lock git ...