sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

2
votes
1answer
85 views

permision denied error ubuntu update with sudo

Running the below command throws the Permission denied error in Ubuntu Server 14.04.1 LTS sudo apt-get update && apt-get dist-upgrade and the error is Get:16 ...
2
votes
1answer
81 views

Is there a difference between “gain root privileges” and “execute any command”?

I recently opened my sudoers file and noticed the following: # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ...
0
votes
1answer
20 views

Can't install or download anything in pear os 8

I recently installed Pear OS 8 and have ran into many problems since. Essentially, I can't download or install anything. At first I was getting a "failed to download repository information" error. I ...
3
votes
2answers
43 views

forward function and variables into sudo su - <user> <<EOF

I have declared functions and variables in bash/ksh and I need to forward them into sudo su - {user} << EOF: #!/bin/bash log_f() { echo "LOG line: $@" } extVAR="yourName" sudo su - ...
1
vote
1answer
28 views

Call sudo from a script called by xbindkeys

I have a macbook pro and I am in the process of binding scripts to control the backlight level on my keyboard. I wrote 2 scripts and they work perfectly I just cant get them to run on a keypress. I ...
2
votes
1answer
53 views

sudo - ubuntu 12.04 [closed]

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 ...
3
votes
2answers
34 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 ...
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
1answer
155 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
35 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
168 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
18 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
23 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
65 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
votes
0answers
38 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
25 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 ...
1
vote
1answer
26 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 ...
0
votes
1answer
21 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
37 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
30 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 ...
0
votes
1answer
93 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 ...
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
2answers
20 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" ...
-1
votes
1answer
60 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
39 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
30 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
73 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 ...
1
vote
2answers
57 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: ...
0
votes
1answer
64 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
49 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
19 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
67 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
71 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
56 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 ...
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
66 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 ...
1
vote
1answer
41 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 ...
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 ...
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
1
vote
1answer
144 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 ...
0
votes
1answer
45 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 ...
3
votes
1answer
48 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
45 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
35 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 ...
2
votes
2answers
49 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 ...