sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
494 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 ...
2
votes
2answers
912 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: ...
23
votes
4answers
47k views

How to make Fedora user a sudoer?

I want to give a Fedora user sudo privileges. How do I do that?
-1
votes
1answer
45 views

Make sudo ask for a password

After installing DevStack, I was forced to put my user as root and gain access. I did that and now I would like to undo it. I removed the line from visudo but still no success. What want like to ...
1
vote
1answer
24 views

Updating a bunch of Macs via SSH. Could use some help

all. I'm working on a script that'll be running from our Mac server, and it will (hopefully) update all of our Macs via Munki (repo is on the same server) and the built-in softwareupdate command. ...
2
votes
1answer
26 views

Problem with either su username -c “./script.sh” and sudo -u username bash -c “./script.sh” and Java classpath

I am seeing some strange behavior that has led me to wonder how the environment differs when running either of these 2 commands, versus using su username and then running the commands as the user one ...
1
vote
1answer
20 views

Root shell sees pip but sudo pip “command not found”

I have installed python 2.7.8 via make and make install and then pip via get-pip. I have to note that I work behind a proxy which I have set up via http_proxy ftp_proxy https_proxy in my user's ...
1
vote
2answers
54 views

Enable ssh root login

I have access to a CentOS server with a user that its not root but belongs to the sudoers list. I do not have the password of root, nor I can't find out what it is (policies of the people who gave me ...
0
votes
0answers
9 views

Running a script with elevated privileges [duplicate]

I need to find a way to run a script with elevated privileges but without compromising security. One suggested that i should use setuid but i don't think that is an option since it can cause serious ...
3
votes
2answers
3k 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 ...
1
vote
2answers
48 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: ...
5
votes
2answers
6k 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
1answer
43 views

Command not found when run with sudo bash

I ssh into my machine and then, in order to run some commands, I need to sudo bash first. In an interactive terminal session, if I do this: [vagrant@33 ~]$ sudo bash [root@33 vagrant]# which bundle ...
1
vote
1answer
80 views

su cannot execute bin/bash/****

I installed Kali Linux on a VM machine and I cannot change my user to root from the terminal using su. The command sudo works fine but when I try to su, it says "cannot execute bin/bash/****(my user ...
1
vote
1answer
31 views

Allow user to use sudo to execute anything, only one executable as nopassword [duplicate]

I have a Linux user that needs to be able to execute any command with sudo, but it should ask for their password for all apart from one executable. Currently my sudoers files looks like: # # This ...
0
votes
0answers
8 views

gksudo not honoring configuration in /etc/sudoers

Some time ago I posted a question which was related to whether it is possible to preserve environment variables when sudoing to a different user. As it turned out, this is indeed possible. When ...
0
votes
1answer
43 views

Details about sudo commands executed by all user

From which log can I get details about sudo commands executed by any user. It should contain the working directory, command, user. It will be helpful if you could provide me a shell script to do so
1
vote
0answers
32 views

sudo and sssd not working with user groups

Having a problem getting sudo that is integrated with sssd to work correctly when we use ldap to store the groups that have the different sudo privs. This works just fine if we have sudo set to go to ...
5
votes
2answers
48 views

Permissions depending on how you login: ssh/su/sudo

As user I have access to a remote linux machine where I can: sudo su - other_user Among other things, this allows me to add my own public key to authorized_keys for other_user, which effectively ...
2
votes
1answer
554 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 ...
27
votes
3answers
20k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
0
votes
1answer
26 views

Security concerns

I've recently been struggling with ways to make a easy way for my father to both mount and unmount a harddrive on a linux based system. I thought of a way to execute a shell script with PHP. The ...
1
vote
1answer
37 views

How do I retain custom PS1 in super user mode?

The problem is this: I set a custom PS1 in my .bashrc, but it changes to the default one when I enter super-user mode. What I expected: ╓[coffee]─[Linux-Tower]─[2014-11-05, 23:41]─[~] ╙[$]-[sudo ...
1
vote
1answer
44 views

Run specific command from .desktop with root

I have a program that I wish all users of my linux install to be able to run with root privileges from a .desktop file. Currently in my .desktop file I have: Exec=gksu command but this of cause ...
6
votes
1answer
112 views

First sudo always slow

The first sudo I enter on my Ubuntu 14.04 server is always slow. The password prompt displays immediately, but after I press enter it takes about 10-15 seconds until the output is printed. All sudo ...
2
votes
2answers
42 views

does sudo always set process limits to the numbers from /etc/security/limits.d?

I have observed the following behavior: [ec2-user@ip-10-66-68-55 ~]$ uname -a Linux ip-10-66-68-55 3.4.103-76.114.amzn1.x86_64 #1 SMP Fri Sep 12 00:57:39 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux ...
4
votes
2answers
528 views

How to get the name of the user who executed a bash script as sudo?

I want to create a bash script that must be executed with sudo but should take into account the name of the non-sudo user who executed it. So if user bob runs sudo ./myscript.sh I would like ...
6
votes
5answers
457 views

Set sudo password differently from login one

As a privileged user I am trying to set the sudo password to another then the one used at login. I have done some research but have not found an answer. Does sudo support that kind of configuration? ...
2
votes
4answers
6k 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: ...
1
vote
1answer
647 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 ...
1
vote
0answers
12 views

How to resolve super user password problem [duplicate]

My super user password no longer works. My own fault I believe, messing around with usermod. Is there a way to resolve this? Using Ubuntu 14.04
4
votes
1answer
165 views

Keeping sudo authentication with gnome-terminal

Can sudo sessions be shared across tabs of gnome-terminal, so that once I use sudo in one tab, I won't have to re-enter my password every time I open another tab and use sudo?
0
votes
1answer
35 views

Open a new bash with sudo powers without reentering the password [duplicate]

I find very useful to have more terminal tabs in different current working directories. But if I need sudo privileges I need to reenter the password for every shell. Is there not a way to extend the ...
1
vote
1answer
1k views

Switch users with sudo or su in a shell script

I inherited this. Long story short I have an XML file that is calling a shell to run some commands. Everything I have tried has failed at the second su in the script. Here are some of the failure ...
3
votes
1answer
46 views

Run command with sudo by default

Just one brick missing in my current wall. Feels to me like it should be easy to solve, nevertheless I got some explaining for you to do to make you understand what I want to achieve. I need a linux ...
0
votes
1answer
44 views

Why does “redirect to a file” is executed as user, even with sudo? [duplicate]

I often encouter this problem and it really bugs me on why it is so. So let's take this example into account : [me@localhost:~]$ sudo command > /some/file.log As far as I know, this will not ...
0
votes
1answer
33 views

Sudo requiring password

On a RHEL server I would like to let a user run a command as root without a password: # uname -a Linux foo.com 2.6.32-220.38.1.el6.x86_64 #1 SMP Wed May 15 08:34:56 EDT 2013 x86_64 x86_64 x86_64 ...
5
votes
2answers
2k views

Graphically ask for password in a bash script and retain default sudo timeout setting

The sudo -A (SUDO_ASKPASS) option apparently causes sudo to lose the timeout (e.g., timestamp_timeout) setting. I want to use the sudo -A option but I want to retain the default timeout (e.g., 15 ...
1
vote
2answers
61 views

How to use sudo to delete the contents of a directory

I have a legitimate need to empty a directory to which my account does not have access (it is a cache directory used by an application, and is owned by the account that runs the application.) My ...
9
votes
5answers
13k views

Can a linux user change their password without knowing the current password?

I'm setting up a few ubuntu boxes, and using opscode's chef as a configuration tool. It would be fairly easy to install public keys for each user on each of these servers, and disable password ...
2
votes
3answers
7k views

Difference between “make install” and “sudo make install”

Sometimes I encounter problems with using make install which gives me a permission denied error when writing to some folders. So instinctively I use sudo make install. Will this introduce additional ...
1
vote
2answers
65 views

Add test user to the sudoers file, to run ifconfig

I would like to see the ifconfig file with test user (under Linux Debian) that's why I have used the sudo task, but the terminal said that: test is not in the sudoers file. How can I take the test ...
0
votes
1answer
49 views

Allow all users to call sudo -l

On my debian server, when a user who does not have any rights in the sudoers file or any include dirs, calls sudo -l, he gets the standard "responsibility header" and is prompted for his password. Is ...
1
vote
1answer
49 views

What does this command “sudo pip3 install name-of-the-file.whl” do?

I'm quite a newbie using the Bash scripting language, but I'm trying to learn it a little bit more. I know that sudo is a command used for administrators' tasks, such that installing or uninstalling ...
1
vote
0answers
25 views

Is it safe to disable password for a user, if it only uses SSH key login?

We want to remove the password usage on a UNIX system. The users should only log in with SSH key. Not password. So their password field in the /etc/shadow file will be "*" and set their password to ...
1
vote
2answers
20k views

How to properly configure sudoers file, on debian wheezy?

I have seen many blog posts that say, it is enough to do aptitude install sudo su root adduser USERNAME sudo But that only protects aptitude, in other words: aptitude install sendmail will ask ...
5
votes
3answers
721 views

Why does “$ sudo echo 'yo' ” work even though echo is a shell built in function? [duplicate]

I understand that sudo cd /directory will return: sudo: cd: command not found because cd is a shell builtin and not a binary. But then, why does sudo echo 'this is a test' works fine? What ...
9
votes
2answers
2k views

Stay at same working directory when changing to sudo

When working on the command line, I often change to sudo using sudo -i. However, my working directory changes automatically to /root. I never want to go there; I want to stay where I was! How can I ...
12
votes
1answer
6k views

sshfs mount, sudo gets permission denied

I am using sshfs to mount a folder with some python projects over ssh to my ~/ directory. $ mkdir -p ~/mount/myprojects $ sshfs user@myserver:/home/user/myprojects ~/mount/myprojects I can perform ...
7
votes
3answers
5k 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, ...