LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-24-2021, 07:38 AM   #1
awreneau
Member
 
Registered: Aug 2003
Location: GA
Distribution: Ubuntu
Posts: 42

Rep: Reputation: 15
nopasswd in sudoers seemingly ignored


I have a sudoers line to allow a group to view logs in a specific folder.

%groupname ALL=(ALL) NOPASSWD: /usr/bin/tail /path/to/files/*.log

when user executes the following:

sudo tail -f /path/to/files/this.log

they are still prompted for password.


visudo -f of the file does not report syntax error

thx for help
 
Old 09-24-2021, 07:40 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
What about the -f option for tail in /etc/sudoers?

Last edited by Turbocapitalist; 09-24-2021 at 07:42 AM.
 
Old 09-24-2021, 09:05 AM   #3
awreneau
Member
 
Registered: Aug 2003
Location: GA
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
that fixed it! I thought that any switches were implied.

Thanks so much!
 
Old 09-24-2021, 09:16 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
No problem

The allowance of all options is only if there are no options given at all, but then that would allow them to use tail to examine any file anywhere on the system and that is probably not what you want.

Code:
%groupname ALL=(ALL) NOPASSWD: /usr/bin/tail
Another option is to make the log files readable by the group in question.

Code:
sudo chgrp groupname /path/to/files/this.log
sudo chmod g=r /path/to/files/this.log
Then you'd also have to adjust the configuration for logrotate to keep those changes. In that way, the requirement for sudo can be eliminated.
 
  


Reply

Tags
passwd, sudo



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add NOPASSWD in /etc/sudoers to only some specific commands xpdin Linux - Security 15 06-11-2017 01:39 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
sudoers problem with using NOPASSWD in conjuction with runas everett-tek Linux - Newbie 3 07-29-2009 07:36 PM
Why does "joe ALL=NOPASSWD: ALL" in sudoers not work? lumix Linux - Newbie 3 06-19-2008 12:04 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration