sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
2answers
96 views

Grant account permission to check service status

I've created a new account svchk and via visudo granted it permission to run the following command /sbin/service postfix status: Cmnd_Alias POSTFIXCMDS = /sbin/service postfix status svchk ALL = ...
0
votes
4answers
107 views

How to know user type in LINUX machine

My account has been created on a LINUX machine. But, I don't know which type of user I am ( root user or normal user) and which type of access I have. Is there any command through which I can check ...
2
votes
1answer
140 views

Copy a local file to a remote server, non-root privileges over sudo?

I'd like to do something like: scp local_file remote_server:/some_directory But in order to gain privileges to /some_directory, we need to call sudo. I know that a similar question had already been ...
2
votes
2answers
95 views

How do I emulate su's behavior with sudo?

I'm trying to make sudo ask for target password, except when run by root. Here's what I do: Defaults:!root targetpw This way it asks for my password, and if I make it like this: Defaults:yuri ...
13
votes
3answers
6k 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?
3
votes
3answers
205 views

What is the best way to add a user to the sudoer group?

So far I have found four different ways to add a user to the sudoers group and not all methods work in all systems. Why so many different implementations? What is the best? What is the standard (i.e. ...
9
votes
4answers
1k views

Sudoers for one day per week?

I have been volunteered by my boss to be the sysadmin for our production redhat server. He asked me to tighten the security to avoid mishaps like rm -f * that occured not long ago. Right now, we ...
3
votes
1answer
162 views

Enable superuser when logged in with another user

Suppose that the machine has two users: Alice (admin) Bob (standard user) While Bob is logged in, how can Alice modify a root file (Bob does not have this permission even with sudo)? Alice tried: ...
0
votes
1answer
76 views

How does this command make a user a sudoer?

According to this DevStack guide, the following commands will give sudo privileges to the stack user: apt-get install sudo -y || yum install -y sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> ...
0
votes
1answer
87 views

How can I allow a group to execute a command as another user?

I'm conservative about my sudoers policy. I'm trying to allow wheel users to run psql postgres postgres as the postgres user (because when ident that's the only way it works). root ALL=(ALL) ALL ...
0
votes
1answer
436 views

(CentOS-6.5) How to implement GNOME environment privilege escalation like GKSUDO?

How would I implement a GKSUDO -like privilege escalation control on CentOS 6.5 workstations? (standard GNOME config, x86_64 and i386) I do not want to share the root password with users, and some of ...
0
votes
0answers
37 views

Installer tries to run sudo for root access

I downloaded Mac4lin from http://sourceforge.net/projects/mac4lin/ I proceeded by following steps 1.Extracted ZIP file. 2. ./Mac4Lin_Install_v1.0.sh it producing following output [Admin@localhost ...
23
votes
7answers
959 views

Should scripts that require sudo fail if they don't have it, or use sudo and prompt?

I have a script which gives me fine-grained control over my backlight brightness and requires sudo to run. It's essentially this: backlight="/sys/class/backlight/acpi_video0/brightness" echo $1 | tee ...
2
votes
3answers
166 views

proper configuration of visudo NOPASSWD for bash backup script

The abstract question is: If script x calls program y, do I need a NOPASSWD entry in /etc/sudoers for x, y or both x & y? (And can x then call sudo -v without a password?) Details: I'm trying ...
2
votes
2answers
61 views

How can I run setfacl -m group:group2:rwx /dev/video0 /dev/snd/* on login?

Q: How do I grant permissions to /dev/video* and /dev/snd/* to a second user, user2 when logged in interactively as user1? I have written a wrapper for sudo that clones the XAuthority settings, and ...
0
votes
1answer
132 views

Non root user performing root actions without sudo/ SetUID in shell script limitation

If I have a script that does some root actions called /sbin/root_stuff and I wanted user bob to have this script run as his shell when he logs in via SSH, I know I can set his shell to a script that ...
1
vote
0answers
638 views

Trying to kill cron job processes found by “ps ax | grep keyword” logged in as pi user

I'm trying to kill several processes from the command line logged into the pi as the user pi. All of the processes have been started by cronjobs, so they should belong to the root user. I'm running ...
0
votes
1answer
57 views

feeding the password without any terminal window (stdout)

I have a command like this: echo "12345" | sudo abcde where 12345 is supposed to be the root password and abcde a program or a command. I have a shortcut which runs this command. I have tested the ...
1
vote
2answers
245 views

I can not log into Ubuntu 12.04

by ignorance and error I renamed the user_name of the directory /home/, called frank_account (home/frank_account) to sixven(/home/sixven) (using gksudo nautilus). Restarting Ubuntu, I get 3 users: ...
6
votes
2answers
168 views

Sudo changes PATH, yet executes the same binary

There are two Python interpreters installed: [user@localhost ~]$ /usr/bin/python -V && /usr/local/bin/python -V Python 2.4.3 Python 2.7.6 Sudo changes PATH when executed: [user@localhost ...
2
votes
0answers
84 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 ...
0
votes
2answers
31 views

How to create a directory which will have access to the user who is installing a package?

I am packaging one of my projects on Debian. The project expects a directory to be created at XDG_DATA_HOME or ~/.local/share/ where the data files will be kept. Now I am trying to create and feed the ...
1
vote
1answer
68 views

How can I find out what options sudo is configured with?

Often when debugging issues with sudo I'll look at the options in the configuration file /etc/sudoers. However it can be difficult to know what options are enabled by default, since they're built into ...
3
votes
2answers
85 views

tee / sudo password cache conflict?

I have a large bash script (Ubuntu 12.04). The script is designed to be invoked by a regular user; only certain commands within the script run with sudo. It is not an option to run the entire script ...
-1
votes
1answer
431 views

How can I run reboot as a normal user without needing to enter a password? [duplicate]

My goal is to use reboot as myusername without entering a password. How can I achieve this? I have read Allowing a user to use sudo without a password and followed the suggestions but it still ...
0
votes
3answers
131 views

Can sudo to user but 'run command as' is denied?

I was wondering how to run a command as another user from a script without password. sudo -l return: (root) NOPASSWD: /bin/su - someuser There is no problem to sudo as someuser. Command sudo su - ...
1
vote
2answers
165 views

disable sudo password prompt for boot script

I've got raspbian installed and need to mount a cifs path after boot is completed. In fstab I got an entry for this with the noauto parameter. When using auto, boot hangs. So in raspbian, the file is ...
1
vote
1answer
396 views

What's the sudo equivalent for FreeBSD?

In pretty much any GNU/Linux distribution you use sudo or su, What's the right choice for FreeBSD 10 ?
1
vote
1answer
65 views

super user group or user?

I am using the following command in Oracle Exadata: sudo su - odiadmin As sudo prompts for my own password, I am wondering if I upgrade myself to super user or do I switch to superuser ...
2
votes
3answers
3k 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: ...
3
votes
1answer
130 views

Some software runs only by root terminal

I'm facing this odd situation here, programs such as gparted, furiusisomount and Rstudio never run by clicking on their icons in the applications menu or by running them with terminal as a normal ...
4
votes
1answer
176 views

sudo testing for credentials

I have a working bash script, that may run from 0 to 8-9 minutes. It requires sudo if it finds a problem and needs to change permissions/ownership on a file. I do not want to wait for the sudo prompt, ...
2
votes
2answers
372 views

How can a normal user trigger a root cron task to execute immediately, without delay?

I have a root cron task that runs every day. But I want to allow normal users to request that it run immediately, if they so wish. It is a harmless process and it can run as often as needed and these ...
20
votes
3answers
5k views

If I sudo execute a Bash script file, will all commands inside the Bash script be executed as sudo as well?

I want to write an automated post-installation script in Bash (called post-install.sh, for instance). The script will automatically add and update repositories, install and update packages, edit ...
1
vote
2answers
102 views

NOPASSWD option not applying to second command

I'm sure that I'm just missing something really simple here, but I have the following sudoers file where I'm intending certain users to be allowed to run a couple of commands as the repomgr user ...
1
vote
3answers
609 views

Run Linux “motion” app as user

I'm trying to run Motion app on a Linux box. For various security reasons, I'd rather run it as regular user than sudo. However, when I run "service motion start" without the sudo in front, it says: ...
1
vote
0answers
42 views

Is there a QT4 equivalent of gksu, not dependent on KDE libraries?

Is there a QT4 application with the same functionality as sudo to gksu that does not require an entire KDE desktop to be installed?
-1
votes
1answer
63 views

I had a folder full of files, then I used “sudo mount” to mount a Windows samba share. Where did the files go? [duplicate]

I'm using a raspberry pi. I didn't think mounting a samba share to a folder full of files would do anything - I thought it would copy the files to the samba share. Now the files are gone from this ...
1
vote
1answer
56 views

Using SUDO to execute a general command inside a non-accessible directory

I want to grep something inside a directory. But the user dont have permissions in the direcotry. Because of some reasons, i am not allowed to change permissions, group or owner. Just want to know i ...
4
votes
2answers
119 views

How to make sudo use root password for some commands and user password for others

I know in /etc/sudoers, one can put Defaults rootpw, but then sudo asks for the root password for all commands. Is there any way I can have sudo ask for the root password for some commands and the ...
0
votes
0answers
89 views

running a command as a less privileged user: `sudo -u` vs `su` being run as root

in an startup-script that is typically being run as user root, i would like to start a program (actually, a server) as a less-privileged user. the script originally used su -s /bin/sh -c ...
0
votes
1answer
124 views

Change sudo and root password on Debian

I have sudo access, but I don't remember the sudo or root password; how do I change it from my limited account using sudo?
1
vote
1answer
89 views

Program acting differently depending on user

I am trying to control an RC transmitter from a PHP site. The command works fine as user "xbian" in the command line: sudo /home/xbian/433Utils/RPi_utils/codesend 34832404 for example, and it works ...
2
votes
2answers
629 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: ...
1
vote
2answers
624 views

Why does this ssh command not work? (cat ./file | ssh <user@host> “cat | sudo -t -t 'cat > /root/location/file'”)

I'm trying to do the following but it's not quite right. cat ~/Desktop/blah.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat | /path/to/blah.png'" I have my public ssh key in the ...
5
votes
3answers
836 views

Why is the 'sudo' password different than the 'su root' password

On my personal machine, I often type sudo in front of certain commands in order to accomplish administrative tasks. I had hoped to avoid doing this throughout the day, by typing su root and providing ...
1
vote
1answer
80 views

Getting sudo to work for an alias

I installed Sublime Text 3 in Fedora 20 which has got GNOME, as I couldn't get it being called from terminal I created a .bash_aliases file which a line like this: alias sublime='sublime_text' And ...
1
vote
2answers
143 views

Script to su -c into a screen is not working as intended

I'm working on a script that will allow me to load up a screen from a user via sudo and su -c. However, when I use it, it will just show the shell of the user: sudo su -c "script /dev/null; screen -r ...
4
votes
10answers
5k views

How to log commands within a “sudo su -”?

If I: [user@notebook ~] sudo echo 123456uu 123456uu [user@notebook ~] Then I can see that in the logs: [root@notebook /var/log] grep 123456uu * auth.log:Jan 9 17:01:51 notebook sudo: user : ...
1
vote
1answer
303 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 ...