sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
26 views

finding and replacing text [duplicate]

Does any one know how to find and replace text in a file. it can be implimented into a bash file. i would like to find the line and the output the text to it the file can only be opened with the root ...
0
votes
1answer
10 views

ERROR: no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; [duplicate]

In my /etc/sudoers.d/myAppCommand file I set some command like this. Cmnd_Alias APP_CMD = /opt/myApp/lib/app-start, \ /opt/myApp/lib/app-stop, \ ...
9
votes
3answers
936 views

Why is it risky to give sudo vim access to ordinary users?

I'd like to create a new user and give him sudo access. To be specific, I want him to use sudo vim and edit httpd.conf. I wrote this in sudoers: user ALL=(ALL) /usr/bin/vim ...
3
votes
1answer
44 views

Can I run a command loaded from .bashrc with sudo?

I have some custom functions and aliases defined in my .bashrc file. Sometimes I need to execute whem as root. I then do something like: $ sudo custom_cmd 80 ...
0
votes
1answer
27 views

How to add “sudo” group

I've done a mistake: I've removed the 'sudo' group, because I have forgotten the -a option (I wanted to add 'video' group): sudo usermod -G video $USER Now, when I want to call sudo I have this ...
0
votes
1answer
37 views

“Sudo” prefixed command doesn't work; without sudo does.

I suspect this has been answered before, but I don't know what this is called, so I can't really search for it. How come this works : $ grep H=p <(udevadm info /dev/ttyUSB0) E: ...
2
votes
2answers
68 views

What is the meaning of sudo sudo?

I am using Cloud9 for Rails development and it uses an Ubuntu environment. In the documentation about using the PostgreSQL database, it says: Connect to the service: $ sudo sudo -u postgres psql ...
-2
votes
3answers
167 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
2answers
35 views

sudo command is unsucessful when invoked from file manager

I'm trying to run the following script on an install of Fedora 20. #!/bin/bash password={password} echo "$password" | sudo -Sk /bin/bash -c '[[ $EUID -eq 0 ]]' [[ $? -ne 0 ]] && zenity ...
4
votes
2answers
778 views

Is 'echo “Defaults insults” >> /etc/sudoers' safe?

Is this safe? echo "Defaults insults" >> /etc/sudoers If yes, can I do this? echo "## First line" >> /etc/sudoers echo "### Second line" >> /etc/sudoers echo "Defaults ...
9
votes
3answers
478 views

Why does the root user need sudo permission?

[root@notebook ~]# grep root /etc/sudoers root ALL=(ALL) ALL Question: Why does the root user need sudo permissions? I've seen it on different UNIX OSes. Can someone please explain this?
1
vote
2answers
45 views

Locked out of my own mac terminal?

So recently, some of my friends had been tampering with my files and data through terminal, so I decided to secure it by doing two things: First, I added the following to my ~/.bash_profile for ALL ...
0
votes
1answer
27 views

Sudoers - group managing and reboot/shutdown

I've got a group (let's say name "group1", ID = 1234) and a user (let's say name "user1", ID="4321"). I want to do two things: I want that user to change passwords from other members of that group, ...
0
votes
1answer
25 views

How does sudo -E work here?

I executed the following command to add a ppa repository in Ubuntu: sudo add-apt-repository ppa:ppaname/ppa This command returned an error that the ppa name format is not correct. Then I looked here ...
2
votes
1answer
29 views

Use current user environment variable in sudoers file

I want some of my users to be able to change their password with sudo command because at the time they log in, they are passwordless (ssh keys connection). My users have no password (and this is ...
1
vote
1answer
40 views

Difference between sudo make and sudo -s ; make

What are the differences between sudo make and sudo -s make First example do not work with my software, there is always a header file missing. Login as root with sudo -s and compile works fine. ...
0
votes
1answer
22 views

how to use command args in sudoers file Cmnd_Alias?

How do I specify command arguments in sudoers? As a background, aws command is actually a gateway to a whole bunch of sub-systems and I want to restrict the user to only run aws s3 cp ...any other ...
0
votes
0answers
41 views

Sudo User: Not able to see the home directory of other users

I created sudo user hrsupport with following commands: hrsupport ALL=ALL, NOPASSWD: /bin/chown, /bin/chmod, /bin/chgrp, /scripts/pkgacct, /scripts/restorepkg How can I achieve this The hrsupport ...
6
votes
2answers
52 views

Linux graphical password dialog trick security

When we run a command by sudo, the password is asked [sudo] password for user If the sudo is not typed the password should not be asked. If asked, I would assume it as a fraud by the application. ...
-1
votes
2answers
58 views

Is it possible to write a script that run su or sudo command without typing password? [duplicate]

Is it possible to write a script that run su or sudo command without typing password?. I googled and its said that su doesn't read password from buffer. So is there any solution?
2
votes
2answers
143 views

sudo as another user with their environment

$ whoami admin $ sudo -S -u otheruser whoami otheruser $ sudo -S -u otheruser /bin/bash -l -c 'echo $HOME' /home/admin Why isn't $HOME being set to /home/otheruser even though bash is invoked as ...
2
votes
2answers
47 views

How can I configure Linux to not require sudo for specific commands for specific users?

I am sure this question has been asked before but I can't find an answer. I would like to configure Linux so that when I enter specific commands (e.g. apt-get), I wouldn't have to enter password as I ...
2
votes
1answer
108 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
87 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
2answers
119 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
75 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
54 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
54 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
11 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
36 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
161 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
67 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
208 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
30 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
27 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
106 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
22 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
89 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 ...
0
votes
0answers
33 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
29 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
25 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
52 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
36 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
128 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
42 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
51 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
65 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
30 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
44 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 ...