sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
0answers
13 views

Configuring sudo interface

Is it possible to configure sudo to get root privilege to a user for running a program with some special switches? for example, how can I configure it for user 'admin' to run netstat command as the ...
26
votes
3answers
55k views

How to make Fedora user a sudoer?

I want to give a Fedora user sudo privileges. How do I do that?
1
vote
1answer
36 views

Why is sudo slow when I mistype my password? [duplicate]

If I'm asked for the sudo password, after typing it in correctly, the terminal moves on almost instantaneously. However, if I mistype my password, it takes a few seconds before working it out and ...
62
votes
20answers
9k views

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a ...
2
votes
1answer
43 views

Why sudo env is not showing all the environment variables?

I have a variable set in a script file in /etc/profile.d/somescript.sh I have modified the /etc/sudoers and added "ansible" user to the sudoers file like this: Defaults !env_reset ansible ...
6
votes
1answer
40 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
0
votes
1answer
811 views

Webmin administrative panel options are missing

When I log into Webmin, with the Ubuntu administrative user frank, I cannot see most of the administrative options: frank is shown as the Administration username in Webmin. I accidentally ...
1
vote
2answers
26 views

How to restore to permissions to sudoers file with no password?

The complete story: I launched an Amazon EC2 "Tier" (VPS) running RHEL 7.1 and created a key for ssh. EC2 automaticly crates a user called ec2-user for new Rhel VPSs, and it have the permissions (in ...
1
vote
1answer
496 views

Allow AD Groups to SUDO

I'm adding some Fedora 20 workstations to our Windows 2003 domain. I've successfully joined the domain with the boxes, and can login with domain accounts. Now I'm trying to allow the default AD group ...
3
votes
4answers
12k views

How to login as root from Bash and do stuff

This is my simple bash: cat test.sh #!/bin/bash echo "hello" su - root -c /path/to/script.sh <<EOF password EOF whoami echo "good bye" But I get this error: ...
2
votes
1answer
2k views

How do I change file/directory permission of a nfs mounted directory, so I access files as user?

On a Ubuntu computer I mounted a directory from another computer using the following line in the fstab: 12.34.56.78:/space/Images /mnt/space/images nfs rsize=16384,wsize=16384,rw,auto,nolock 0 0 ...
6
votes
2answers
4k views

sudo: ulimit: command not found

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 ...
6
votes
2answers
421 views

bash does not autocomplete my command when using sudo?

I'm using SaltStack. I would like to auto-complete the minion name when calling salt command. The following line has been added into ~/.bashrc: complete -o default -o nospace -W "$(sudo ls -1 ...
0
votes
1answer
34 views

PAM timestamp - how to inspecting the /var/run/sudo/<user> file?

The centos documentation stated that: ... In the PAM timestamp scheme, the graphical administrative application prompts the user for the root password when it is launched. When the user has ...
0
votes
0answers
37 views

How to manage any command access privileges on debian linux

I am using Debian 7, and my desktop is xfce. I want to achieve managing any command on Linux. For example, executing /usr/bin/xfce4-taskmanager command would not require sudo privileges so any user ...
1
vote
0answers
22 views

Allowing sudo kill for remote user for recovery purpose. Security implications?

I'm planning to create user allowed to SSH in and with right to sudo kill in case something disables local terminal/keyboard/display etc. Would probably add ps and/or htop to the list, as well. I ...
3
votes
1answer
160 views

program needs to be run as root by any user and can be located anywhere

I have some program called foo that needs root privileges when it executes. foo needs to be able to be run by any user and can be located at any path. The reason this program can be at any path is ...
2
votes
2answers
56 views

how to pass environment variable to sudo su

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesnt work. How can I pass the env variable $DUMMY to su? -p doesnt work with -l.
2
votes
3answers
196 views

“ sudo: source: command not found”

$ source /etc/environment $ sudo source /etc/environment [sudo] password for t: sudo: source: command not found It seems that a different shell than bash is run to execute source ...
1
vote
3answers
51 views

Differences between sudo and su in inheriting environment

Why can the command run by sudo inherit the environment from the parent shell process, while the shell process after sudo su to the root user doesn't? t@ocean:/tmp$ export ME=tim t@ocean:/tmp$ sudo ...
1
vote
1answer
57 views

how to enable sudo for one directory

I have Redhat 6.3 and I want to enable sudo command for chown,kill and chmod, so under root user I did the following: visudo #add the following line aabuhasna ALL=(ALL) NOPASSWD: /usr/bin/kill, ...
1
vote
1answer
84 views

What does “ALL ALL=(ALL) ALL” mean in sudoers?

If a server has the following in /etc/sudoers: Defaults targetpw ALL ALL=(ALL) ALL Then what does this mean? all the users can sudo to all the commands, only their password is needed?
2
votes
2answers
2k views

Using sudoers to allow php to run command

I am trying to get my php page to run this command: shell_exec("sudo /home/xbian/433Utils/RPi_utils/codesend {$num}"); So I added this entry to my sudoers file with visudo: www-data ALL=NOPASSWD: ...
0
votes
1answer
30 views

create a linux user with create files and write permissions without sudo access

I want to create a user in such a way that it can create a file and update the contents of the file. useradd username Now for sudo, we can create username and linking to sudo like below: useradd ...
0
votes
1answer
40 views

What are the differences between sudo and the use of groups?

I know these are tools used for improving security. But what I would like to know is what they are and how they work?
3
votes
1answer
752 views

sudo command executes without prompting for password

For some reason, I suddenly do not need to enter the password when issuing sudo some_cmd. Entered command just runs without ever prompting password, even if I am not logged in as user root. Commands ...
6
votes
3answers
126 views

What bad things could happen if we don't use sudoedit?

We know it's safer* to use sudoedit, but what bad things can happen if we have the following in sudoers? Cmnd_Alias FOO = /bin/ed, /usr/bin/ed, /usr/bin/vi foouser LOCALHOST = NOPASSWD: NOEXEC: FOO ...
0
votes
2answers
130 views

apt-get update failed to fetch and /sources.list.d/ empty

Running the sudo apt-get update command, I got the following error: Fetched 988 kB in 16s (59,3 kB/s) W: Failed to fetch ...
4
votes
2answers
276 views

How can I run growisofs via sudo?

Whenever I've attempted to run growisofs via sudo I've always gotten the following error message. $ sudo -i growisofs :-( growisofs is being executed under sudo, aborting! See NOTES paragraph in ...
13
votes
3answers
12k views

`/etc/sudoers` — specify `env_keep` for one command only?

Is there any way to specify that sudo should preserve certain environment variables for specified commands only? For some purposes I'd like my $HOME env. variable preserved when I run certain ...
1
vote
3answers
661 views

Pass arguments to a command run by another user

I have a bash script that is supposed to take some arguments and then run in a different user: test.sh #!/bin/bash sudo su user2 <<'EOF' echo $1 EOF However it prints blank: $ ./test.sh ...
1
vote
3answers
64 views

Why is gksu asking me for root password and not my password?

On one of my systems, I'm running Gentoo Linux and I've installed x11-libs/gksu-2.0.2-r1. I've disabled the root account using sudo passwd -dl root and I want to be able to run GUI apps which need ...
1
vote
1answer
44 views

Difference between adding sudo user with adduser or gpasswd

To add a new sudo user I believe I can call: # to create a new user sudo adduser newusername and to allow this user to use sudo I can do: sudo adduser newusername sudo or sudo gpasswd -a ...
11
votes
4answers
7k views

sudo cannot open /etc/sudoers

sudo does not work. I have installed Arch Linux onto a USB key formatted with BTRFS. The output of sudo is: $ sudo sudo: unable to stat /etc/sudoers: Permission denied sudo: no valid sudoers sources ...
2
votes
0answers
73 views

Security of sudo not asking for a password after the first time

After using sudo and entering a password to do so, sudo remembers that we have entered a password and we do not have to enter a password the next time we use it. I am concerned about the possibility ...
0
votes
0answers
32 views

Applications not starting with sudo

I'm using Linux Mint 17 (Qiana) in my Oracle Virtual Box. Whenever I try to open an application with sudo, it is not working. For eg. if I try to open sublime text editor using the command sudo subl ...
8
votes
6answers
6k 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
2answers
296 views

LD_LIBRARY_PATH always blank after sudo

I get shared library errors whenever I seem to install software manually. Upon executing echo $LD_LIBRARY_PATH it shows up as.. nothing. I've tried adding /usr/local/lib to a .conf file in ...
1
vote
1answer
57 views

ssh with -Y results in “shell-init: error retrieving current directory: getcwd: cannot access parent directories…”

I ran an X app sudo'ed from my normal account, using: mylappy$ ssh -Y me@myhost.com me@myhost.com's password: [me@myhost ~]$ sudo su - [root@myhost ~]# su - me -c 'xauth list' |\ grep `echo ...
3
votes
1answer
130 views

How do I allow non-root users to control a systemd service with instances?

I need to allow users in the dba group to control the database@ services. The answer to this related question is to just list all systemctl "verbs" that I want to allow in the sudoers file, however, ...
5
votes
1answer
118 views

Edited sudoers file with text editor - now can't run sudo

I now know that I should never try to edit the etc/sudoers file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I ...
2
votes
1answer
26 views

Run a command a as a certain user and multiple groups with sudo

I am trying to allow an normal user to run some applications under other UIDs for process separations. The applications should run with certain groups permissions (like audio or cdrom). In the ...
1
vote
1answer
22 views

Parallels on Mac - can no longer sudo within Ubuntu

I have been using Parallels on my Mac to run Ubuntu for a couple of weeks and it's been fine. Today I tried to install a package and received the following error: {user} is not in the sudoers ...
0
votes
2answers
66 views

executing command as su

I am executing this command as su. I have made the connection with SSH (using sshNet), and then when I try to set the command su -, I get no response. I have the password and the command I would like ...
43
votes
7answers
62k views

How to run a specific program as root without a password prompt?

I need to run something as sudo without a password, so I used visudo and added this to my sudoers file: MYUSERNAME ALL = NOPASSWD: /path/to/my/program Then I tried it out: $ sudo ...
1
vote
1answer
62 views

Running some parts of a script as an unprivileged user with shell environment

I am creating an instance configuration script that sets up a machine. I am running the script via sudo i.e. sudo run.sh. Most of the steps require root access but some of the script's steps do no ...
4
votes
2answers
1k views

Sudo Su automated login

I want to automate the login process with sudo su. I have seen lot of questions on these, but none of them are working for me. Automate login with sudo and su Here's my what I tried so far echo ...
0
votes
4answers
17k views

Username is not in the sudoers file. This incident will be reported

I am running Ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called "User Account" in addition to my account that I usually login to use Ubuntu. Well that was ...
1
vote
1answer
1k views

Apt-get, no sudoers file

I am trying to install a module using apt-get. For that I do the following: sudo apt-get install But I get the following error: sudo: can't stat /etc/sudoers: No such file or directory sudo: no ...
0
votes
1answer
254 views

Some index files failed to download - Linux Mint 17.1 Cinnamon

Running sudo apt-get update i get the following error message: ... Ign http://packages.linuxmint.com rebecca/upstream Translation-en_US Ign http://packages.linuxmint.com rebecca/upstream ...