sudo is a tool which allows users to run commands as another user (usually the root user)
4
votes
1answer
49 views
sudo: How to allow only one argument to a command?
I want to add an entry to my suoders to allow one user to run a command with exactly one non-option argument.
# tail -1 /etc/sudoers
ALL ALL = (:tool) NOPASSWD: /bin/echo [a-z]*
$ sudo -g tool ...
2
votes
2answers
22 views
haproxy and socat sudo
I created a test user and want to limit this "test" user to run only the following command via visudo.
echo "show stat" | socat stdio /var/run/haproxy.sock
visudo
test ...
-1
votes
2answers
46 views
su command works without prompting password
I'm on a RHEL server where the su command drops the user into root without prompting for a password. Obviously, this is a pretty big cause for concern which I'd like to fix. I'm not in contact with ...
-9
votes
1answer
44 views
When I am root, how do I run one command as user “pi”? [closed]
When I am root, how do I run one command as user "pi"?
Distribution Wheezy.
1
vote
3answers
44 views
which and sudo not using the same path
$ which reboot
/usr/bin/reboot
$ sudo reboot
Sorry, user myusername is not allowed to execute '/sbin/reboot' as root
What am I missing here?
Thanks for your help.
0
votes
1answer
20 views
visudo changes not taken into account
I added three lines to my sudo configuration, using visudo.
User_Alias INSTALLERS = myusername
Cmnd_Alias INSTALL_CMDS = /bin/yum, /bin/make
INSTALLERS ALL = (root) NOPASSWD:NOEXEC: INSTALL_CMDS
...
0
votes
1answer
32 views
I can't make sudo su on old version CentOS with LDAP
I configured many servers with the option to make "sudo su" with ldap users, and works fine.
But in 2 servers (CentOS 5.7 and 5.5) this option show me an error:
[user] is not in the sudoers ...
0
votes
1answer
41 views
How to run sudo without Sudo installed
I do not have sudo installed on my machine, but I have a third party program which runs as different user other than root and tries to execute sudo command. Is there a way to enable this program to ...
0
votes
2answers
43 views
Troubleshooting SUDO Slowness with STRACE
I'm having trouble with sudo on some systems. It is taking anywhere from 15-30 seconds to complete a sudo command or to even login to the system.
I ran an strace and can see where the delay is ...
0
votes
1answer
19 views
How can I have a deamon invoke scripts as another user?
I am configuring a server connected to an UPS.
The UPS is managed via apcupsd and it calls some scripts when there is a power outage and when the situation goes back to normal.
The server is running ...
0
votes
0answers
37 views
OpenSolaris 10: Unable to open /usr/local/etc/sudoers: Permission Denied as root
Had to install sudo for an opensolaris box today and everything installed without issue. Unfortunately, even as root, when running sudo I get:
sudo: unable to open /usr/local/etc/sudoers: Permission ...
0
votes
1answer
44 views
su between regular user accounts fails with “su: incorrect password”
user1 wants to su to user2 (both are non-root). When user1 runs su - user2, he's prompted for user2's password as expected, but the password is never accepted.
user1@host $ su - user2 (switch ...
1
vote
1answer
32 views
How to create a sudorule in freeIPA for the sudoedit builtin
Currently, when I want to grant some group of users access to edit a file, I proceed as follows:
ipa sudocmd-add --desc=Vi IMproved default-mode, no-exec, no-suspend mode' '/usr/bin/rvim'
ipa ...
0
votes
1answer
25 views
Allow User Account to run a single command using SUDO privelages
I have a machine running Ubuntu 12.10. I have two user accounts setup, my account, and another user. I am able to run SUDO commands, but the other user isn't in the SUDO'ers list.
What I'm trying to ...
0
votes
1answer
69 views
Bash: php comand not found when called from a script run with sudo
I have this weird problem. The php command is not found in one specific sitiation.
I try to call the command in three different ways. Only one of them fails:
Being user john I create a simple ...
0
votes
1answer
30 views
Retain agent-forwarding in sudo
I want to be able to connect to a server, start a sudo shell, then use agent forwarding to connect to another server (in order to use SCP to copy files to a protected area). But:
...
1
vote
1answer
64 views
sudo group member privileges in the sudoers file
I've just installed sudo on my machine (Debian Wheezy).
While I was editing the sudoers file using visudo, I noticed this line:
%sudo ALL=(ALL:ALL) ALL
On several tutorials and blogs (although ...
0
votes
1answer
74 views
Recommendations for bootstrapping Ubuntu server
When I create new Ubuntu 12.10 instances, I typically bootstrap them by manually SSHing onto the machine and editing the sudoers to put a NOPASSWD on the default user (e.g., ec2-user, azureuser, ...
-2
votes
2answers
69 views
How do I report vulnerability in sudo? [closed]
I have found a vulnerability in sudo and I was able to reproduce it on multiple instances of xubuntu. It didn't seem to work on debian.
How do I report it properly?
I have read so much about ...
1
vote
1answer
57 views
Allow normal user to run PHP script as root using SUDO
How can I allow a normal user on Ubuntu to run php scripts?
sudo php /path/to/script/script.php
Basically the script needs to be run as root but the users does not have root privileges on their ...
3
votes
4answers
157 views
Disabling ssh as root on Linux boxes and the challenges of writing scripts
It's a common suggestion from security-minded people to disable ssh as root on Linux boxes. My question is this:
Let's say you normally write lots of scripts which ssh to a large number of Linux ...
1
vote
1answer
53 views
Trying to use sudo with bash subshell: env variables not working
I have read a few other posts, it appears cumbersome to do multiple commands within sudo. Heredocs suffer from limitation of not being able to do redirection of stdin/stdout. Here in any case is a ...
1
vote
2answers
181 views
Can't su to user other than root on CentOS
I'm able to SSH to my server (CentOS 5.9) using an admin account with sudo privileges:
$ ssh admin@myserver
Last login: Wed Feb 27 19:23:11 2013 from [IP ADDRESS]
[admin@myserver ~]$
Then I can su ...
0
votes
0answers
50 views
sudoers works with hostname but not with the full domain name (fqdn)
I'm using puppet to propagate a sudoers file to several environments with different domains like so:
Host_Alias STG1 = *.stg1.wa.acme.com
Host_Alias STG2 = *.stg2.wa.acme.com
This works ...
-2
votes
1answer
202 views
How to set up SUDO rights for execution of Python script from PHP [closed]
I run Raspbian Wheezy on my Raspberry Pi, and i want to call a Python script from PHP.
That all works great (i call 'exec python go.py' from php) but now i want to call a script which needs root ...
1
vote
3answers
101 views
Can't use sudo without password on Ubuntu 12
Maybe my question is stupid but I'm really stuck...
My OS is Ubuntu 12.04
My sudoers:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in ...
0
votes
1answer
65 views
Default user not in sudoers file
In Debian 6, right after my installation. I try to run a command as root, only to find out that my account isn't in the sudoers file. This is from the main user account that is set up under ...
0
votes
1answer
214 views
How do I set both NOPASSWD and SETENV on the same line in sudoers?
In the sudoers file, how can I use multiple Tag_Specs on the same line.
Normally if I don't want to ask for a password I will do something like this:
who where = (aswhom) NOPASSWD: commands
I ...
0
votes
1answer
29 views
CentOS Switching to mysql user
I'm wondering is it even possible to use the mysql user as one for login to retrive some data via ftp? Such as:
su mysql (And if so, what could the password be, the default one or where in some point ...
0
votes
2answers
95 views
CentOS lost Root Access
For some reason I cannot access my root user via SSH. It displays the error on login:
could not open session.
However I happen to have another user account that is a normal non-sudo user. Is there ...
11
votes
2answers
510 views
Allow complex sudo command on Debian Linux
I need to allow a specific command on a Debian Linux box for a single user. I've tried this in the /etc/sudoers file:
# User privilege specification
zabbix ALL=NOPASSWD: /usr/bin/apt-get ...
2
votes
1answer
51 views
sudo does not preserve TMPDIR
The sudo manpage tells me, that I can preserve the environment by passing the -E option, which does not work in the case of $TMPDIR:
> env | grep TMPDIR
TMPDIR=/localdata/tmp
> sudo env | grep ...
-1
votes
1answer
32 views
running script containing sudo in cron [duplicate]
#!/bin/bash
value=$(<man.txt)
echo "$value"
if [ "$value" == "true" ]; then
echo "startedif_manthan"
ps -ef|grep sym |awk '{ print $2 }'|sudo xargs kill -9;
sleep 30;
sudo sh ...
0
votes
1answer
49 views
copying files using non-root rsync
I have a primary server and a secondary server and I wish to copy files over from the primary to the secondary using rsync. I have mounted the primary disk onto the secondary using NFS and am copying ...
1
vote
2answers
113 views
Why doesn't sudo -i respect the sudoers file
To ensure the proper PATH environment variable is setup, I am using the sudo -i options, but am finding that the sudoers file isn't being respected.
Here is my setup:
/etc/sudoers:
Defaults ...
0
votes
2answers
68 views
Sudo seemingly not obeying -S parameter
I am running some scripts as part of pre/post deploy using DeployHQ, I need to be able to call the script on one line and for there to be no feedback from the terminal so I want to pass the password ...
-2
votes
2answers
54 views
setting up sudo account
I want to create a managed account with root powers and the ability to su as root if need be to manage the box without needing root. What is the correct way to do it?
Does this work?
...
0
votes
1answer
37 views
OpenLDAP How to give sudo access to a limited set of machiines only
I am trying to setup an LDAP server for multiple machines. I want to have an account which only has sudo access in a some machines, not all. Will having a multi-valued sudoHost in a SudoRole solve ...
2
votes
1answer
225 views
GNU screen: ‘Cannot open your terminal '/dev/pts/3' - please check’
There is daemon in my system, it runs inside of a screen instance and all that is done from an unpriveleged user. I’ve added myself to special sudo group allowing me to run screen from this user, but ...
0
votes
2answers
65 views
Linux: Apply ownership to all files created in folder
My first question, so be kind...
Basically, I have a folder that a user group has access to. This folder has a program in it that runs as root(via sudo) then outputs result files(xml files) to a ...
7
votes
5answers
664 views
Log all commands run by admins on production servers
It is company policy for admins to login to the servers via a personal username, and then run sudo -i to become root. Upon running sudo -i, sudo will create an environmental variable called ...
3
votes
1answer
45 views
sudo failing even though ownership and modes set correctly
I am getting the dreaded sudo: must be setuid root error even though the executable in /usr/bin/sudo has ownership root:root and mode 4755 (-rwsr-xr-x). /etc/sudoers is mode 440. My user is in sudoers ...
1
vote
2answers
326 views
I've accidently removed sudo and yum from my linux server
I've been trying to upgrade PHP on a linux server. Using the instructions given on this page I ran this command:
sudo yum remove php php-cli php-common php-devel php-gd php-mbstring
Somehow, ever ...
4
votes
1answer
128 views
What's the difference between “sudo su -” and “sudo -i”? [duplicate]
Possible Duplicate:
What is the difference between sudo -i and sudo su -
I know both commands result in gaining a root-shell. But there are some differences.
On some servers e.g. the prompt ...
0
votes
1answer
120 views
Troubles monitoring a zimbra installation with nagios
I am trying to monitor my legacy zimbra installation (running on an outdated Ubuntu 8.x) from my nagios install (running on a more recent OpenBSD).
The problem is that when I run check_nrpe from the ...
1
vote
1answer
75 views
Set working directory of a command run via sudo?
I have a command that I run via sudo. This command needs to have its working directory set to the directory where the command is installed. The user that calls sudo has no permissions in this ...
2
votes
1answer
222 views
sudoers restriction only works when using “sudo”, how to restrict regular usage?
I have the following in my sudoers.d/nginx file:
deployer ALL=NOPASSWD: /etc/init.d/nginx reload
This works if I run the command as sudo:
$ sudo /etc/init.d/nginx start
[sudo] password for ...
0
votes
2answers
79 views
Advice regarding SUID and sudo on Ubuntu Server
Just wanting a bit of advice. I have root access to a server and I want to create a second user and execute everything via sudo should I need to rather than logging in as root. The file /etc/sudoers ...
3
votes
1answer
81 views
How can I use etckeeper via sudo with different users and have the correct user in the commit message?
I'm working on a server with several admin users. Each of them can use sudo to make configuration changes. We're keepeing our /etc directory version-controlled using etckeeper.
However, when I or ...
0
votes
2answers
142 views
any way to run sudo before all commands automatically(well, sort of…read on)
I would always like to use the sudo command when operating as our "serveruser" so that all my actions are recorded in the sudo log and I can reverse engineer it later. I however do not want to type ...



