The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
13 views

How to restrict sudoers with relative path

I'm trying to set up the sudoers file to allow users to run any excutable file under a directory. Example : /opt/tivoli/tsm/client/ba/bin/* How can I restrict the user not to any relative paths? ...
0
votes
1answer
35 views

Can't sudo because password is disabled

So, in my attempt to prevent the default ubuntu user from logging in, and to prevent the default sudo user me from logging in with a password, and thus enforcing to use the private key, I managed to ...
0
votes
2answers
20 views

How to allow a user to view a particular file via sudoers?

In Linux, I want to allow a normal user to view only one file in a path. How to give the entry in sudoers file. Is the below one is correct? user ALL = /bin/cat
9
votes
3answers
1k views

Why does the system have /etc/sudoers.d? How should I edit it?

Last time, I asked about the risk of these (in /etc/sudoers): user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf %group_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf ...
0
votes
1answer
21 views

Can sudoers on a server use my ssh keys if I generate them with a password?

If I set up ssh keys for ssh login (to GitHub for example) from a server that I have access to, can sudoers on that server use my ssh keys if I generate them with a password (assuming they cannot ...
0
votes
1answer
63 views

The risk of vim -Z (rvim)

Last time I asked about the way to prevent risks caused by these configurations: user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf or %group_name ALL=(ALL) /usr/bin/vim ...
2
votes
1answer
39 views

Get back to sudo group without recovery mode

I made a big mistake when executed command: sudo usermod -G vboxusers me instead of "gpasswd" or "adduser", and I lost sudo group. Is it possible restore it, if I dont know root password, and have ...
3
votes
0answers
95 views

How to prevent security flows caused by sudo vim? [closed]

I learned doing sudo vim causes security problems. For example, user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf or %group_name ALL=(ALL) /usr/bin/vim ...
0
votes
1answer
101 views

amazon linux yum update changed sudo root permissions

I ssh'ed into my server, ran sudo yum update, and now I'm asked for a password to sudo anything. Looking back through update logs, I noticed this: /etc/sudoers.d/cloud-init saved as ...
0
votes
0answers
596 views

sudo - /etc/sudoers is world writable on Ubuntu OS

By mistake I change the permission of /etc/sudoers file on Ubuntu OS, now when applying any command using sudo, its giving error, sudo: /etc/sudoers is world writable sudo: no valid sudoers sources ...
0
votes
0answers
13 views

How to deny an specific user to reboot or shutdown in Red Hat 6 with visudo

Hello and thanks for helping me in this question. I just have in /ets/sudoers something like this: ##User Aliases <BR>**User_Alias CLIENT = jhonny </BR> CLIENT myserver = ...
0
votes
1answer
20 views

disable users from creating new shell instances

Is there any way I can disable users from creating new shell instances through sudoers file? also disable them to set any environment variables? I would like to write a line in the sudoers file ...
1
vote
1answer
40 views

force sudo to forget password immediately after exit everytime

If I execute sudo su, I am asked for my password ( [sudo] password for ... ) After do some stuff, I can leave this root mode with exit. If I execute again sudo su, I will not be asked for a password ...
0
votes
1answer
70 views

output of sudo -l confusing me

(habdbsync) NOPASSWD: ALL, (habdbsync) !/bin/sh, !/bin/ksh, !/bin/csh, !/bin/tcsh, !/bin/zsh, !/bin/bash, (habdbsync) !/bin/su, (habdbsync) !/usr/bin/ssh, !/usr/bin/scp, !/usr/bin/slogin (root) ...
0
votes
1answer
84 views

Replacement for “su user_with_sudo; sudo -s” for user without sudo-rights?

Let's say I have two user accounts: user (without any sudo permissions) user_with_sudo (with all sudo permissions) Now, I'm logged in as user but want to do something as root, e.g. switch to a ...
0
votes
0answers
80 views

Sudo suddenly not working correctly on OS X?

I have started noticing that commands requiring the use of sudo on OS X Mavericks are failing, e.g. I just updated Meteor and it couldn't write the launcher script sudo cp ...
1
vote
1answer
66 views

Adding group permissions with sudoers with NOPASSWD still prompting for password

Fedora 20, clean install. I added the following lines to my sudoers file with visudo: %power ALL=NOPASSWD: /sbin/shutdown I then created group "power" and added my account to this group. ...
2
votes
1answer
147 views

Prompted for root password even with sudoers edited with NOPASSWD

I'm trying to configure my sudoers file so that I'm not prompted for a password every time I need to access root privileges. I'm still getting prompted for my password, so if anyone has advise on ...
0
votes
1answer
52 views

Username expansion in sudoers file command possible?

I have the following in my sudoers file : User_Alias DU=%domain\ users DU ALL = NOPASSWD:NOEXEC: /sbin/mount.cifs \\\\* /home/* -o sec=krb5\,* ,/bin/umount -t cifs /home/* This works, users who are ...
1
vote
0answers
96 views

allow sudo user to execute multiple commands for only ONE file

I'm trying to allow only one user to be able to use only 'cat,head,tail' on some of the log files. What is the exact syntax to use here. I tried user ALL /bin/cat /var/log/maillog Which works ...
1
vote
1answer
14 views

Disable an #include instruction in sudoers

Can a sudoers #include instruction be disabled with an additional # character? Or rather just delete the leading # character? (I wish I would understand what the sudo developers had on their mind ...
0
votes
1answer
281 views

ubuntu superuser got corrupted

I was trying to save times to type password for sudo because one of my scripts had to be randomly repeated quite often. I googled some information about how to bypass typing password and applied to ...
0
votes
0answers
89 views

how to make my ldap client as sudo user in mac

I loged in as ldap client against ldap server authentication. when i open terminal and enter sudo -i, i get an error message that this user is not added in sudoers file. what to do get root ...
0
votes
0answers
42 views

sudoers: allow users to remove from their home directory

I'd like to add a sudoers rule that says users are allowed to remove files from their home directory , but I don't see any way to limit arguments to be a subdirectory of the users' home. Is there any ...
0
votes
1answer
180 views

Permission denied on sudo remove

I have two users userA and userB. userA has permission over a file named cache. I want to give permission to userB to remove the file. I have made following entry in /etc/sudoers file : userB ...
0
votes
1answer
389 views

Run startup script with another user

I have two users user1 and user2. And tomcat has owenership of user1 and started with user1 only. I need to make a rule for user2 such that user2 can starts/stop tomcat but tomcat should always be ...
0
votes
0answers
35 views

sudo ENV_KEEP not always preserving

When I run sudo -s, my environment is preserved. However, when running a simple sudo <command> it appears not to be preserved. The contents of my sudoers file: mafro@ip-10-xx-xx-250:~ > ...
0
votes
1answer
212 views

Sudo Cmnd_Alias Optional Arguments

I would like to allow a command to be run under sudo with or without arguements. For example, both of these should work: rm -f /etc/stuff rm /etc/stuff/item.txt To get this to work, I need this ...
4
votes
0answers
2k views

'user is not in the sudoers file' but actually is

I have already read a lot of posts about enabling sudo-access for a specific user but those couldn't help me so far. The situation is: I'm running Debian Testing. On the system there are only two ...
0
votes
2answers
59 views

remove specifying the full path in sudoers

I am trying to add a NOPASSWD entry for 'sudotest.sh' (or any script/binary that requires sudo) in my /etc/sudoers file (redhat) but in order to make it work, I must specify the full path. The ...
1
vote
1answer
318 views

How can I override a default of rootpw in sudoers

I have a sudoers file with many entries. At the top is a Defaults setting: # default sudo password is the ROOT password (not the invoking user's password) Defaults rootpw However there is one ...
4
votes
1answer
149 views

Passwordless sudo works for one user, but not for another

I struggle to create passwordless sudo for one user on my Debian server. I've added the following line to the sudoers file: deployer ALL = NOPASSWD: ALL but it doesn't work. To my surprise, I can ...
0
votes
0answers
41 views

What is wrong with this configuration of sudoers file?

I have to execute a shell script as another user, but without be prompted for password. I've edited the etc/sudoers file with visudo, adding the following line. _www localhost=(otheruser) ...
0
votes
2answers
3k views

How do I fix an invalid /etc/sudoers file if root access is disabled?

This pertains to my Raspberry Pi, on which I have Raspbmc installed. I do realize that there is a Raspberry Pi StackExchange site, but I figured I might get more eyes on this problem here. The issue ...
1
vote
0answers
55 views

sudoers syntax for specifying a list of executables

I want my user (username "wim" in group "wim") to be able to use sudo apt-get and sudo dpkg without needing admin password. I tried editing sudoers file with sudo visudo, and I added in this line: ...
1
vote
1answer
1k views

Broken sudo on amazon web services ec2 linux centOS

So I had no idea of the dangers of messing with the /etc/sudoers file, and was just trying to make a simple change in there. However, I seem to have put something with incorrect syntax in there, ...
0
votes
1answer
2k views

How to allow user to preserve environment with sudo?

I'm running into the following error trying to allow some environment variables to pass through to the new environment when running sudo: sudo: sorry, you are not allowed to preserve the environment ...
12
votes
1answer
14k views

sorry, you must have a tty to run sudo

I had already asked this question in Stack Overflow, but I've been asked to post it here. So doing the same. I ran this command using my java program- sudo -u <username> -S pwd I got this ...
1
vote
1answer
102 views

Let a user to run a command as a member of a group he does not belong to, using `sudoers`

How can I let a user U to run a command /usr/bin/C as a member of a group G (while he does not belong to the group G), using sudoers on Debian Wheezy?
2
votes
1answer
6k views

Why there is no sudoers file: “/etc/sudoers: No such file or directory”?

I am trying to add a new admin user, but: # adduser username admin adduser: The user `username' does not exist. # man sudoers No manual entry for sudoers # less /etc/sudoers /etc/sudoers: No ...
0
votes
1answer
2k views

Shutdown Debian from php script

I am trying to shutdown my RaspberryPi running Raspbian from a php script running on lighttpd webserver. shell_exec("sudo /sbin/shutdown -h now 2>&1"); I added lighttpd ALL=(ALL) NOPASSWD: ...
0
votes
1answer
460 views

Running phantomjs with shell_exec under cron job

I have something like this: $re = shell_exec("sudo /usr/local/share/phantomjs --version"); Unfortunately this gives me another problem: sudo: no tty present and no askpass program specified ...
0
votes
1answer
311 views

How to config sudoers file?

I'm using ubuntu server 12.04 LTS I want to know how to configure my sudoers file (obviously, using visudo), to permit an user to run commands like root (doing something like "sudo service x ...
0
votes
1answer
111 views

Gentoo : cannot modify the hostname file as a sudoer

I am trying to change the hostname of a Gentoo host using a sudoer account. I use the following procedure : sudo rm -f /etc/conf.d/hostname sudo touch /etc/conf.d/hostname sudo echo "hostname=foo" ...
0
votes
1answer
32 views

sudo for only ufw?

I want to allow the johnuser sudo access for just the ufw command. Is this the appropriate statement to write into /etc/sudoers ? johnuser ALL=(ALL) /bin/ufw I'd try this right away only I ...
1
vote
1answer
2k views

Edit sudoers to allow /sbin/ifconfig down with NOPASSWD

I'm trying to edit /etc/sudoers so that I can execute a bash script with a root password. so far every edit I've tried to sudoers is not working. I've tried adding each of these lines: %admin ...
15
votes
3answers
40k views

How to check if I have sudo access?

I recently got into trouble because of this. $sudo vim /etc/motd [sudo] password for bruce: bruce is not in the sudoers file. This incident will be reported. Is there a way to check if I have ...
2
votes
1answer
639 views

Can't use sudo's arguments as non-root in Fedora 16

I am using a long-installed Fedora 16 box, and whenever I type "sudo -v", "sudo -l", etc. as a regular user (non-root), I get this output: [user@* ~]$ sudo -v env: -v: No such file or directory ...
0
votes
0answers
128 views

why sudo create directories in wrong permission drwxr-sr-x?

I run sudo on ArchLinux(on x86_64) and Fedora(on sh4 cpu). They behavior different. sudo mkdir x ls -l x It shows drwxr-xr-x root root x on ArchLinux. But shows drwxr-sr-x root mygroup x on Fedora ...
0
votes
2answers
77 views

How can I run commands like setfsuid, setfsgid as a normal user?

Normally only the root user has permission to run these commands. Is any way I can run these as a normal user?