Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

sudo logging question

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

sudo logging question

  • Quote

Post by dirtbag » Wed May 03, 2006 6:08 pm

hey gentooheads,

Im using the proximity scriptie at
http://gentoo-wiki.com/TIP_Bluetooth_Proximity_Monitor
and it works great, but in my syslog, I get beaucoups of messages from it

May 3 14:05:25 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool rssi 00:12:8B:7B:73:B7
May 3 14:05:27 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool con
May 3 14:05:27 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool rssi 00:12:8B:7B:73:B7
May 3 14:05:29 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool con
May 3 14:05:29 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool rssi 00:12:8B:7B:73:B7
May 3 14:05:31 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool con
May 3 14:05:31 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool rssi 00:12:8B:7B:73:B7
May 3 14:05:33 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool con
May 3 14:05:33 zim sudo: jason : TTY=pts/6 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/hcitool rssi 00:12:8B:7B:73:B7

any slick ideas on how I can /dev/null just these messages from this particular command?

in my /etc/sudoers, I have
jason ALL=NOPASSWD:/usr/bin/hcitool logfile=/dev/null
and I tried to use the logfile on the end of that line, but it doesnt seem to work in this instance

any ideas?

-DB
Top
snizfast
n00b
n00b
Posts: 43
Joined: Wed Sep 22, 2004 11:05 pm

  • Quote

Post by snizfast » Wed May 03, 2006 7:26 pm

Have you tried filtering the sudo stuff out in the syslog-ng.conf file similar to this?

Code: Select all

filter f_messages { level(info .. warn)
        and not facility(auth, authpriv, cron, daemon, mail, news, kern, user)
        and not program("sudo"); };
That will take it out of the message log and then you put all of the sudo stuff to a seperate file.
Talk is cheap, supply exceeds demand
alias nocomment='sed -e '\''s/#.*//;/^\s*$/d'\'' '
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Wed May 03, 2006 7:29 pm

well, the only problem with that is that it would trap all sudo messages, I was looking for a way to just trap these that come from this one specific command being run every 2 seconds so I dont fill up my disk.. I guess I could do what you suggest, but I dont believe its what Im looking for.

-DB
Top
hegga
Apprentice
Apprentice
Posts: 210
Joined: Wed Jun 04, 2003 10:30 am
Location: Norway
Contact:
Contact hegga
Website

Re: sudo logging question

  • Quote

Post by hegga » Wed May 03, 2006 7:56 pm

dirtbag wrote:in my /etc/sudoers, I have
jason ALL=NOPASSWD:/usr/bin/hcitool logfile=/dev/null
and I tried to use the logfile on the end of that line, but it doesnt seem to work in this instance

any ideas?
logfile
Path to the sudo log file (not the syslog log file). Setting a path turns on logging to a file; negating this option turns it off.

Code: Select all

!logfile
should work then...
hegga
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Wed May 03, 2006 8:24 pm

jason ALL=NOPASSWD:/usr/bin/hcitool !logfile
is that what you mean?
that didnt seem to work either
Top
snizfast
n00b
n00b
Posts: 43
Joined: Wed Sep 22, 2004 11:05 pm

  • Quote

Post by snizfast » Fri May 05, 2006 5:09 pm

Just to double check you are worried about the log files filling up your disk? If you can get it out of the rest of you log files that should work. Optionally you could create a logfile which goes to /dev/null

Code: Select all

destination null { file("/dev/null"); };
Hope that helps.
Talk is cheap, supply exceeds demand
alias nocomment='sed -e '\''s/#.*//;/^\s*$/d'\'' '
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Mon May 08, 2006 3:57 pm

jason ALL=NOPASSWD:/usr/bin/hcitool destination null { file("/dev/null"); };
still doesnt work.

I want ONLY output from THIS particular entry to go to /dev/null/ all the rest of the sudoers actions I want logged.

-DB
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Thu Jul 26, 2007 9:07 pm

Were you ever able to turn off sudo logging? I tried both these from the man page, but am having problems getting it to work.

Code: Select all

Defaults        !logfile
or

Code: Select all

Defaults        logfile=/dev/null
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Mon Aug 06, 2007 3:09 pm

not sure what happened... but im not getting these messages anymore..
and I dont have anything on my sudo line blocking the log output either.
:?

-DB
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Mon Aug 06, 2007 5:29 pm

dirtbag wrote:not sure what happened... but im not getting these messages anymore..
and I dont have anything on my sudo line blocking the log output either.
:?

-DB
Actually we figured it out... This was the solution:

Code: Select all

Defaults        !syslog
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Mon Aug 06, 2007 8:54 pm

Thanks fer sharing that Faye! :)

-db
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Wed Aug 08, 2007 3:09 pm

dirtbag wrote:Thanks fer sharing that Faye! :)
lol... my name is actually Mike, but Cowboy Bebop is one of my favorite animes :lol:
Top
dirtbag
Guru
Guru
User avatar
Posts: 508
Joined: Tue Feb 18, 2003 9:50 pm
Location: NC
Contact:
Contact dirtbag
Website

  • Quote

Post by dirtbag » Wed Aug 08, 2007 3:23 pm

heh... i know.. me too.. ;)
Top
Post Reply

13 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic