sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
614 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
101 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 ...
2
votes
1answer
101 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
535 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 ...
3
votes
1answer
4k 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
2k 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
528 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
1k 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. ...
-1
votes
2answers
655 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
2k 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
435 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
1k 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
395 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
1k 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
528 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
1k 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
1k 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
1k 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
402 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
263 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
364 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 ...
4
votes
5answers
3k 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
3k 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 ...
14
votes
4answers
16k 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 ...
3
votes
2answers
10k 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
184 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
254 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
4k 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
3k 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
3k 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
193 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 ...
5
votes
1answer
279 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 ...
4
votes
2answers
21k views

How to add self to sudoers list?

I've added myself into the sudoers users list by using the command root@debian:/home/oshirowanen#adduser oshirowanen sudo If I try to run that command again, root@debian:/home/oshirowanen# ...
0
votes
1answer
3k views

Masquerading as another user from sudoers file?

My /etc/sudoers file has following entries:- ## Allow root to run any commands anywhere root ALL=(ALL) ALL agupta ALL= /sbin/,/usr/sbin/,/bin/,/bin/cat /etc/sudoers ADMINS ALL= !/usr/bin/su, ...
3
votes
1answer
459 views

Redirecting output in the shell, permissions

I have a question about permissions. Distro: Debian GNU/Linux 6.0.4 (squeeze) So I have a folder with a php script in it. Both folder and file are owned by User1 If I do this: php script.php I ...
0
votes
3answers
1k views

What does sudo su work but su does not? [duplicate]

I have tried this on Fedora and on Ubuntu. kshitiz@kshitiz:~$su su: Authentication failure kshitiz@kshitiz:~$sudo su root@kshitiz:/home/kshitiz# I am entering the same password in both the cases. ...
3
votes
2answers
8k views

sudo: password prompted even when NOPASSWD is set [duplicate]

~/bin$ cat setbrightness id echo $1 > /sys/class/backlight/intel_backlight/brightness ~/bin$ whoami rag ~/bin$ sudo -l Matching Defaults entries for rag on this host: env_reset, ...
6
votes
2answers
8k views

What is the difference between gksu and sudo?

I presume this applies to any Gnome desktop. What is the difference between these two commands? According to the Ubuntu documentation and questions that reference it, the former also sets the $HOME ...
0
votes
2answers
9k views

Changing root password does not change sudo password

I'm trying to change the password that get's asked when doing sudo. I'm in Ubuntu. Doing 'sudo passwd' or 'sudo passwd root' does give me the two new password questions, and it successfully changes ...
2
votes
2answers
204 views

Does the sudo user need a home directory?

In my setup, my aim is to have A standard user with minimal permissions to use on a daily basis A superuser account, defined in /etc/sudoers. Does this second user need a home directory? Both of ...
1
vote
2answers
150 views

run a command as different user with available sudo permissions

I want to run the below command echo 1000 > /sys/class/backlight/intel_backlight/brightness i cannot do it it like below beecause bash is the process that actually directs output to the ...
14
votes
1answer
18k views

Is it okay to disable requiretty?

I'm trying to set up a deploy script using Capistrano At a step cap deploy:setup script is connecting to my server and trying to run commands that create directories. Then I see an error: msudo: ...
2
votes
1answer
460 views

Setting the root password vs. sudo -i

Should one always set a root password, or is sudo -i acceptable? Two problems is in reading other posts (maybe junk I realize): sudo -i eliminates the need for a password. Isn't that a problem for ...
2
votes
1answer
87 views

Using sudo to give access to another account on same machine

There are two unix accounts A and B.I want to execute a unix command from account B such that the command behaves as if it was executed from account A .How can I do this ? The problem here is that ...
5
votes
4answers
5k views

Should I use `sudo` or `su` in a startup script?

I have a personal program, that has a server/client design. The server daemon part of it, should be run as its own limited user, and the program was not designed to drop its root privileges (if ...
1
vote
1answer
305 views

Cannot enter in centOS with any user

I am using cent OS Operating system without GNOME. In the starting, it asks localhost login: Password: It has one user named service under group name service whose password is also service. I ...
1
vote
0answers
150 views

External HDD read/write permission changing from a cron job

So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab ...
4
votes
1answer
25k views

Suddenly, I Can't login with correct password (greeter & tty)

This might be a duplicate of other password related questions but it's somehow eccentric. I have 3 accounts in my Ubuntu 12.10 system (one standard and two administrators). One of the administrator ...
1
vote
0answers
648 views

git deploy using sudo nopasswd

I'm trying to write simple post-recieve script, which would switch to webserver user and pull git repository. To do so, I added git user to sudoers (I've added this to very last line): git ALL = ...
1
vote
1answer
1k views

Apt-get, no sudoers file

I am trying to install a module using apt-get. For that I do the following: sudo apt-get install But I get the following error: sudo: can't stat /etc/sudoers: No such file or directory sudo: no ...