sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

2
votes
1answer
48 views

sudo - ubuntu 12.04 [on hold]

I am running a Ubuntu 12.04 LTS server. Today I have been doing some maintenance to the server, and a security audit. I realized that sudo is not working the way I expected it to. In the default ...
0
votes
1answer
9 views

sudo rule with placeholder

i want to allow the use of /usr/sbin/ufw for a special user. But only for a given command: in my /etc/sudoers file i have now (for blocking IPv4 addresses): blockuser ALL=NOPASSWD: /usr/sbin/ufw ...
1
vote
1answer
37 views

Use sudo from another programm

I was wondering it is safe or an acceptable practice to use sudo to run an application from another one. For example, Let's say I have an application that uses a configuration file to do its work and, ...
3
votes
2answers
32 views

Is there a way to run sudo without running another unneccessary command?

I wanted to run two sudo commands, piping the output from one to the other. However, when I haven't entered my password for sudo recently, it prompts me for the password. The pipes and two sudos seem ...
3
votes
1answer
154 views

Why is $HOME inherited when I start a shell with sudo?

I'm setting up a Vagrant box and I noticed something I found odd. root@box:~# sudo --user=vagrant bash bash: /root/.bashrc: Permission denied vagrant@box:~$ export declare -x HOME="/root" Why is ...
3
votes
0answers
27 views

How to disable sudo related logging for successful command execution under CentOS/Fedora?

You can disable sudo related log messages via adding something like Defaults:juser !syslog to our sudoers file. That is disabling logging to syslog. But under e.g. CentOS/Fedora there is an auditd ...
3
votes
2answers
161 views

Is there a graphical sudo (kdesudo, gksudo, su-to-root, …) tool that works passwordless?

Apparently gksudo is not obeying /etc/sudoers, neither does kdesu. Therefore asking the other way around... Is there any su-to-root, gksudo, kdesudo, etc. alike tool, that supports starting gui ...
4
votes
1answer
17 views

How to transition into another domain when invoking sudo?

I have a daemon (collectd) that executes a script for data collection (via smartctl). The exec-plugin of collectd mandates that external scripts are executed under a user != root. The plan is to set ...
1
vote
2answers
22 views

using sudo create another process

I have wrote a shell script names testShell.I run this shell using command: sudo sh testShell Then I use ps -ef|grep testShell|grep -v grep to check the processes created.I find that system ...
2
votes
2answers
95 views

How to retroactively make a script run as root?

I'm writing a shell script, that needs to be run with root privileges. I can check if a user has root privileges with sudo -nv || echo "no sudo", but that doesn't help me, if his credentials are ...
0
votes
1answer
19 views

Disable root password caching

How can I disable root password caching? I looked at This Question, but I didn't really understand how to do it, is not the same as my question but it is indirectly related. I tried adding this to ...
4
votes
2answers
63 views

How to execute a command that requires root permission without sudo?

I'm trying to execute traceroute -d being authenticated as a "standard" user with sudo privileges. However if I run sudo traceroute -d it will be execute by the root user so I'm wondering how can I ...
1
vote
1answer
25 views

Exporting Variables from Read

I'm asking the user to input some data using Read that data will be save on a variable that is going to be use in another shell script. However, for some reason is not working. This is what I got in ...
-1
votes
0answers
37 views

How to run the script that requires root acccess as a regular user without adding that user to sudoers?

I have an account with root privileges and need to run the install script for a specific user. I don't want/can't analyse the script upfront to figure out the list of all other packages it is going to ...
0
votes
0answers
24 views

How to grant sudo permission for a .py script on a apache folder?

I've exemplo.py in an folder /opt/lampp/htdocs/cgi-local/exemplo.py folder. The script creates a socket that needs super user permissions. My question was a little confusing? I need to access ...
33
votes
3answers
24k 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?
1
vote
1answer
2k 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 ...
0
votes
1answer
20 views

/etc/sudoers file help in giving access to all command in UNIX

/etc/sudoers file help in giving access to all command in UNIX. I read it has rules specified like #root ALL=(ALL|ALL):ALL that specifies root accesses. My question is when we execute a command ...
0
votes
2answers
36 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 ...
2
votes
1answer
29 views

Get commands a user can run from /etc/sudoers?

I need a shell (ksh) script that can be executed locally on a box that will return a list of users who have sudo access to a server and what commands they can run. For example I want to know that ...
1
vote
1answer
35 views

sudoers file and passwd only for selected group

I have 3 users in "production" group: John, Steve and Bob. In "sales" group are: Sam and Jack. Now, I would like to give John permition to change passwords of all users but only in "production" ...
0
votes
1answer
84 views

sudo not working on debian

Why sudo command is not working on my fresh debian installation. I had this error after entering my root password: Sorry try again .. or / and incorrect password attempt EDIT : In my ...
0
votes
2answers
15 views

shared object file open error with “sudo command” but NOT with “sudo bash” then same command?

I'm having a hard time getting my brain wrapped around how LD_LIBRARY_PATH is handled differently for the following three cases: run as a regular user run via "sudo command" run via "sudo bash" ...
0
votes
1answer
526 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
992 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
56 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
28 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
36 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
25 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
69 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
10 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
54 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
62 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
119 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
44 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 ...
1
vote
0answers
18 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
61 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
66 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
54 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
902 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 ...
0
votes
1answer
27 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
40 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
61 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
123 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
47 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
644 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
520 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? ...