sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

4
votes
1answer
25 views

System environment variables not appearing in sudo

I have the following line my /etc/environment file: BROKER_URL=tcp://xxx.30.8.163:61616 I run this and get: $ set|grep BROKER_URL BROKER_URL=tcp://xxx.30.8.163:61616 Then, I run: $ sudo bash # ...
-2
votes
1answer
54 views

Need to run su command If I am a user with sudo access

I am a user in Oracle Linux server with sudo access. If I run su command, system prompts for password. When I input my account password, system gives message Incorrect password while I login ...
4
votes
2answers
110 views

Process substitution from curl to bash as root

I'm trying to run a script from URL as root with this command: sudo bash <(curl -s http://copy.com/gLVZIqUubzcS/popcorn) But I'm getting this error: bash: /dev/fd/63: Aucun fichier ou dossier ...
5
votes
1answer
69 views

Writing raw images safely to USB sticks

Trying lots of different linux, on all kinds of hardware I find my self typing commands like this quite often: sudo dd if=xubuntu-13.10-desktop-amd64.iso of=/dev/sdc bs=10240 Needless to say, ...
1
vote
2answers
85 views

How to edit /etc/hosts without sudo?

I have a machine that I can only access using SSH. I was messing with the hostnames, and now it says: ssh: unable to resolve hostname I know how to fix it in /etc/hosts. Problem is, I need sudo ...
1
vote
2answers
18 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
59 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 ...
1
vote
0answers
18 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
76 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 ...
5
votes
3answers
185 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
67 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
142 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
58 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
24 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
50 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
19 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 ...
21
votes
7answers
813 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
59 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
36 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
62 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
45 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 ...
1
vote
2answers
95 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
80 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
52 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
20 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
32 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
52 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
70 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
57 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
72 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
89 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
39 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
256 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
0answers
71 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
100 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
115 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 ...
14
votes
3answers
1k 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
45 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 ...
0
votes
3answers
121 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
18 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?
0
votes
1answer
37 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
36 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
79 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
45 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
46 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
52 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 ...
1
vote
2answers
212 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
340 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 ...
1
vote
3answers
137 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 ...