sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
1answer
99 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
110 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
1k 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
362 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
271 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 ...
4
votes
1answer
2k 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
85 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
4answers
7k 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
171 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 ...
5
votes
1answer
332 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
760 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 ...
21
votes
3answers
9k 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
191 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
1k 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
57 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
71 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
67 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
185 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
158 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
2answers
381 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
120 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
1k 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
905 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
2k 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
100 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
321 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 ...
5
votes
10answers
13k 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
822 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 ...
4
votes
2answers
349 views

How can I find and/or print sudo's lecture file?

I'm using Ubuntu and I would like to find and/or print the sudo lecture that is printed to the screen the first time a user executes a sudo command. How can I do this? I'm unable to find the lecture ...
8
votes
3answers
2k views

How do you process an entire command as sudo that involves redirecting or piping?

I am trying to follow what I assume is best practises of using sudo instead of root account. I am running a simple concat file operation such as: sudo echo 'clock_hctosys="YES"' >> ...
4
votes
1answer
161 views

Is there any point in using `sudo` when you are the sole user of your machine?

I'd like to know if there is any reason why I should use sudo instead of su, taking into account that I am the owner and sole user of my machine (and hence have root access whenever I want). Also, in ...
15
votes
2answers
1k views

Is sudo not installed by default in Debian?

I was reading a guide to install some software and came reading until this shocking statement: sudo is not installed on Debian by default. Make sure your system is up-to-date and install it. As ...
1
vote
2answers
55 views

Running a program to output in Dutch

I'm running KDE Arch linux and trying to update my system using pacman and have it output in Dutch. I've tried the following sudo LANG=nl_NL.UTF-8 pacman -Syy sudo KDE_LANG=nl_NL.UTF-8 pacman -Syy ...
-3
votes
1answer
102 views

where is this HOME environment variable and what do I have to add -H too it?

I recently attempted to run a boot up script which failed I didn't know why it failed so I posted a question about that here. chkconfig bootup script failing, script runs good manually Where the ...
5
votes
2answers
344 views

What would I get when sudo a kernel-destructive program?

It suddenly comes to me how easy it will be for a sudoer to crash the kernel, so I tried something like this: #include<stdio.h> int main(){ printf("hello world"); int a; ...
60
votes
19answers
9k views

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a ...
0
votes
1answer
375 views

Can't access the directory /etc/ppp/peers?

I want to read some configuration file. The problem is that I can't move in the folder peers and typing the command ls -l, I see this permission's record: drwxr-s--- root dip ... I never seen that ...
8
votes
2answers
331 views

How do I edit a file as root?

Are there any special considerations to editing a file as root? What is the safest way to do this?
0
votes
1answer
98 views

Process substitution over ssh with sudo in Bash shell

What is the proper way to do something like this: diff <( ssh -t myuser@hosta 'sudo httpd -M') <(httpd -M) When I want to compare the output of the 2 commands, the first on a remote host the ...
-1
votes
1answer
945 views

How to install sudo package in Unix? [closed]

I'm new to this sudo command. I needed to do sudo mount -o remount. But it is giving me the following message sudo: unable to stat /etc/sudoers: No such file or directory sudo: no valid sudoers ...
7
votes
1answer
97 views

How does the Linux desktop perform system actions?

The Linux desktop can perform several actions which is otherwise not available to the user when logged in from a terminal. Actions such as system shutdown, and changing system time are accessible only ...
4
votes
2answers
6k views

ls *.* gives: “*.*: No such file or directory” message [duplicate]

I'm using Linux app-server 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux. When I go to a directory with several files named name1.php, name1.html, name2.php, etc. and type: $ sudo ls ...
7
votes
1answer
254 views

Cannot expand asterisk without proper permission

Can someone explain to me the following? $ ls -ld /temp/sit/build/ dr-xr-s--- 3 asdf qwer 4096 Jan 31 2012 /temp/sit/build/ $ ls -ld /temp/sit/build/* ls: /temp/sit/build/*: Permission denied So ...
4
votes
2answers
191 views

Is there something like one-time sudo?

Is there a way to have a one-time sudo account? My use-case is the following. I have an Ubuntu station with no remote ssh allowed to that machine. The machine generally serves as a public-use ...
3
votes
5answers
10k views

How to start a program in the background

The program Boblight does not run in background. There is no noticeable difference between executing sudo boblightd and sudo boblightd& How can I solve this problem that the console will ...
5
votes
2answers
349 views

What are the parameters in sudoers file

The sudoers file has the following line: root ALL=(ALL) ALL I have read that the first field is the user. Then first ALL is all terminals, and (ALL) means as any user, and last ALL means any ...
7
votes
3answers
2k views

Difference between sudo -i and sudo su [duplicate]

I was wondering what the difference is between sudo -i and sudo su?
1
vote
3answers
8k views

sudo: no tty present and no askpass program specified

I have a perl script that I fork from another script that I launch from a web browser via mod_perl. The forked script (which ends up running as apache) needs to sudo service X stop as part of a ...
1
vote
1answer
78 views

Executable not visible when run with sudo [duplicate]

Platform: Ubuntu 10.04 VM running out of VirtualBox File details: -rwxr-x--- 1 myuser myuser 123 2013-10-31 16:10 myscript.sh The executable is visible in the directory: >type myscript.sh ...
1
vote
1answer
307 views

Exiting a Bash script when a sudo child quits

I'm trying to launch a couple of sub-programs from a bash script and then wait on either of them to quit before quitting the other and exiting the script. CMD1PID= CMD2PID= exit_trap () { ...