sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

-1
votes
1answer
265 views

How to install kdesudo in OpenSUSE 12.3

I'm hoping this is a stupid question with a simple answer, but I've been hunting around for half an hour and cannot find a way to install kdesudo in OpenSUSE 12.3. I need to use kdesudo because kdesu ...
3
votes
1answer
230 views

Is it a bad idea to add myself to the sudo group?

Members of the sudo group in my Debian install can execute anything without entering a password. This is convenient, but seems like a bad idea. NOTE: My computer is an ordinary desktop, not a server ...
2
votes
1answer
240 views

sudoers: NOPASSWD in same line as PASSWD:ALL?

Is this combination legal: username ALL=(ALL) NOPASSWD: /usr/bin/foo, PASSWD:ALL or do they conflict or cancel each other out?
1
vote
2answers
730 views

How can I scp a file that my user can't read but I can sudo?

Can I use scp to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?
2
votes
2answers
2k views

How to run sudo commands remotely via ssh -t?

I have a script that logs into a remote host via ssh -t and uses sudo service foo restart. The requirement is to avoid the prompt for a password on the remote host. The remote host authenticates via ...
6
votes
2answers
759 views

/etc/sudoers - Insults - How to add a list of insults?

I intend to play with the linux insults and add a few. However, i only could figure how to add a single insult but not a list or the location of the file that contains the insults.
5
votes
2answers
735 views

How can I cd into a directory as root?

Let's say there's a directory that I don't have the privileges to access. Obviously sudo cd foo won't work, because cd is a shell builtin in every shell ever. So far, I've just been using sudo bash ...
43
votes
3answers
1k views

How do the internals of sudo work?

How does sudo work internally? How is it possible that it can become root without having the root password, unlike su? What syscalls, etc. are involved in the process? And why is however sudo does it ...
3
votes
1answer
253 views

sudo command executes without prompting for password

For some reason, I suddenly do not need to enter the password when issuing sudo some_cmd. Entered command just runs without ever prompting password, even if I am not logged in as user root. Commands ...
-1
votes
1answer
133 views

How do i change the password for root using webmin, where i have no more access as root?

I changed the root password, using webmin it shows me successfully done. $ uname -a Linux .com 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux $ echo -e ...
7
votes
2answers
8k views

How to disable requiretty for a single command in sudoers?

I want to disable requiretty so that I can sudo within scripts, but I'd rather only disable it for a single command rather than everything. Is that possible within the sudoers config?
2
votes
1answer
593 views

How to execute php file as different user securely?

I want to confirm that my thoughts are correct as this is about security matter. We have web based application which is using db2 database. db2 runs under the db2inst1 user. Now we want users of the ...
1
vote
1answer
452 views

Running program as root without using sudo with normal user account

Is there a way to force to run program as root (with normal user) when there's no sudo on the machine (and can't be added)?
3
votes
2answers
409 views

Programatically use visudo to edit sudoers?

I have a sudoers file stored in our svn repo. I want to svn export it to /etc/sudoers but can't do it because sudo detects that it was not edited by visudo and throws syntax errors. What exactly does ...
3
votes
5answers
350 views

Protect folder from sudoers

Is there an ability to not allow sudoers view your folder (only you and root can access folder)?
2
votes
1answer
345 views

Why do programs run with sudo not have system theme applied?

I am currently running Linux Mint 14 - Mate Version and I have noticed that whenever I run a program with sudo, the system applied GTK theme(applied in "Appearance") does not work properly. Therefore ...
1
vote
1answer
239 views

Can't edit /proc/sys/net/core/wmem_max [duplicate]

Recently my wireless network has being stopping to transfer data from some irregular time intervals that vary from 30 seconds to 20 minutes, and every time I need to plug off and then on the wireless ...
3
votes
2answers
1k views

Allow a specific user or group root access without password to /bin/date

As the title would suggest, I'd like to give a user or group full root access to the /bin/date command, including any manner of arguments as defined in the man pages. I understand /etc/sudoers ...
0
votes
1answer
295 views

How to start a GUI program with PHP from website

My firm has some Ubuntu 12.04 running where there is no display attached and that are behind different firewalls. The visitor on local websites on that servers should be able to start a GUI program ...
0
votes
0answers
64 views

How to start a GUI program in a VM with PHP

I have an Ubuntu 12.04 VM running on my online server where there is no display attached. I want to start Teamviewer there on that VM to get graphical access to that server. I guess I have to give ...
3
votes
1answer
68 views

Remember password after `sudo -i`

If I do sudo <command> and enter the password, my Debian Squeeze remembers the fact I passed the password and never asks for it for i.e. 15 minutes. But if I do sudo -i and then exit, the ...
1
vote
3answers
241 views

SUDO: Username condition in sudoers file

I'm trying to allow my user (via sudo, launched in a script) to copy a file from their home to a web directory. Command would be: sudo cp /home/$LOGNAME/file_source /var/www/$LOGNAME_file_dest So ...
2
votes
1answer
1k views

Stop su from asking for a password

I am trying to run the following command as deploy from Java (the JVM is running as the user tomcat): sudo -u deploy /path/to/my/bash/script.sh PARAM1 PARAM2 My sudoers file has the following in ...
14
votes
2answers
690 views

How long is the password for executing a command with sudo cached?

If I run a command which requires root privileges with sudo, I will be asked to enter the current user's password. After that for a while, if I execute the same sort of commands with sudo, I won't be ...
2
votes
2answers
230 views

Command added to visudo still is failing on permissions?

My sudo file has two commands in it right now that are allowed to run without logging in as root. It looks like this: user ALL=(root) NOPASSWD: /home/user/prog1.py user ALL=(root) NOPASSWD: ...
3
votes
1answer
459 views

sudo: unable to initialize PAM: No such file or directory

While trying to build the NumPy Python math module with Intel's Math Kernel Library (MKL) on OSX 10.8.3, I was running into some problems with the Accelerate and vecLib frameworks overriding the MKL. ...
0
votes
2answers
296 views

TAB autocomplete on sudo sh

When I say sudo sh, TAB stops working as autocomplete signal on my Debian. How can I enable TAB key autocomplete after I say sudo sh ?
2
votes
0answers
911 views

How to run ssh -t user@remote 'sudo nohup bash -c “comand”' in background

I want to run a script on a remote host with sudo privilege, someone suggests that I should use nohup and ssh -t, like the following command: The script ls; sleep 10; echo finish is crafted here to ...
4
votes
1answer
90 views

when timing a command execution time with sudo, `time` should be before `sudo` or after `sudo`?

when timing a command execution time with sudo, time should be before sudo or after sudo? time sudo command or sudo time command which one is correct? the output seems very different to me ...
0
votes
1answer
240 views

Difference between sudo su - user and sudo -iu user [duplicate]

I was wondering if there were any difference (in environment ?) between doing sudo su - user and sudo -iu user From what I know: By using sudo su - user I open a new shell as user, and the ...
0
votes
3answers
117 views

How to limit administrative privileges to various config files?

I want one administrator to be able to edit the /etc/fstab file but one administrator to not be able to edit the fstab file. Both administrators need access to all other administrative tasks. Is ...
1
vote
2answers
463 views

How do I set vim as the default editor when I sudo?

I'm working on a CentOS 5.9 machine, and I simply want to type sudo vi somefile and have my trusty vim with syntax highlighting, etc. This seems simple enough, but after many attempts, it's ...
1
vote
1answer
223 views

chmod and chown not working in sudo called script

Based on this Serverfault question, my git user has permission in sudoers to run a wrapper script to move files into my webroot with git. Everything is working fine except for the chmod and chown ...
2
votes
1answer
801 views

Getting no tty present and no askpass program specified when using git over ssh

I'm trying to push a git commit from my laptop to my server but keep getting the following error message: remote: sudo: no tty present and no askpass program specified To ...
-1
votes
1answer
676 views

Where does sudo get the currently logged in username from?

When I tried to "sudo su" instead of "sudo su -" after having been logged in as root and su-ing to another user, it tries to sudo me as the new user, but via root... When I type env, it shows still ...
0
votes
2answers
402 views

What does a sudo command do?

Being a unix noob, what does this command do? $sudo /usr/bin/su -something Is -something a password or username for running commands under this username?
0
votes
1answer
129 views

Where to configure which password sudo needs

on some OS sudo requires the users password, on others it's root's password. Where is the config file to decide on this?
1
vote
2answers
91 views

The HOST variable in /etc/sudoers

suppose mymachine:/etc/sudoers includes the line joe someremotehost = (ALL) NOPASSWD: ALL but someremotehost:/etc/sudoers does not say anything special about joe, then what effect does the above ...
0
votes
2answers
127 views

Files created by 'make' aren't getting executable permissions by default

I'm trying to build a project, and when I use the command make, I get the following errors: /bin/sh: line 4: .deps/ipset_bitmap_ipmac.Tpo: Permission denied make[2]: *** [ipset_bitmap_ipmac.lo] Error ...
2
votes
5answers
1k views

Environment variable does not seem to work in sudo

I use apt behind a firewall, so I specify a proxy in the http_proxy environment variable. What I have done is added the following line to both .profile and .bashrc (for good measure) of the root ...
2
votes
3answers
1k views

Using sudo in openSUSE without actually changing to root user (i.e., like in Ubuntu)

I recently started trying openSUSE 12.3 after having used Ubuntu for a few years. I'm still getting used to openSUSE's treatment of su (and sudo) vs. Ubuntu's use of sudo. I've been reading the ...
10
votes
4answers
6k views

Why doesn't “sudo su” in a shell script run the rest of the script as root?

A sample script can be as below: #!/bin/bash sudo su ls /root When using ./test.sh as the normal user, instead run ls as super user and exit, it switches to root; and when I logout, it executes ls ...
0
votes
2answers
202 views

Where are sudo incidents logged?

When someone is not in the sudoers group and try to use sudo, get an error message like this one: yzT is not in the sudoers file. This incident will be reported. I'm trying to figure out in which ...
0
votes
1answer
106 views

Don't execute a command with sudo, unless it's configured as password-free

I'm not sure if sudo supports so, I want to execute a command, only if this command is configured as NOPASSWD, that is, if the command can be run without password, run it; Otherwise quit directly. So ...
5
votes
2answers
146 views

Auto completion for inaccessible directories

I'm trying to get a auto completion for folders that I don't have permission to view / enter, my first thought was to use compgen and sudo to do the completion manually, but looks like compgen is a ...
2
votes
2answers
2k views

Linux (RedHat) `sudo su -l <<user_acct>>` does not source profile

As stated, having trouble with loading the default profile of <<user_acct>> when doing sudo su -l <<user_acct>>. Inside .profile, if [ -r "${HOME}/.profile.custom" ]; then ...
1
vote
5answers
1k views

How to securely automate running commands as root with “sudo su -”?

hint (on client side, how to encrypt files/pwd's): # encrypt pwd with ssh key: openssl rsa -in ~/.ssh/id_rsa -outform pem > ~/.ssh/TEMP-id_rsa.pem 2>/dev/null openssl rsa -in ~/.ssh/id_rsa ...
2
votes
1answer
1k views

No valid sudoers sources

I've gone through the Google searches, but the results always have an extra clue that I'm not seeing. The error: [testuser@testhost] $ sudo -ll sudo: no valid sudoers sources found, quitting sudo: ...
2
votes
0answers
134 views

/proc/net/wireless does not show values unless run as root

cat /proc/net/wireless does not show statistics for wireless devices unless it is run as root, even though the permissions on the file are 444. The same seems to apply when accessing statistics via ...
3
votes
1answer
163 views

How does having /dev/fd make running shell scripts under sudo safe?

At the end of the man page for sudo, there's the following remark: Running shell scripts via sudo can expose the same kernel bugs that make setuid shell scripts unsafe on some operating systems ...