• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Enable sudo I/O Logging

by admin

sudo will normally only log the command it explicitly runs. If a user runs a command such as sudo su or sudo sh, subsequent commands run from that shell are not subject to sudo’s security policy. The same is true for commands that offer shell escapes (including most editors). If I/O logging is enabled, subsequent commands will have their input and/or output logged, but there will not be traditional logs for those commands.

1. Edit /etc/sudoers file by using command: visudo and add the entry below:

# visudo
Defaults log_output
Defaults log_input
Defaults iolog_dir=/backup/SUDO_IO_LOG

For example,

# cat /etc/sudoers
...
# add log
Defaults log_output
Defaults log_input
Defaults iolog_dir=/backup/SUDO_IO_LOG

2. log location

# pwd
/backup/SUDO_IO_LOG
# ls
00 seq

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. How to Recover Deleted rpm Package Files(libraries, configuration files) in CentOS/RHEL 7
  2. Linux OS Service ‘syslog’
  3. Mail Server Components – MTA, MDA and MUA
  4. How to debug systemd boot process in CentOS/RHEL 7 and 8
  5. CentOS / RHEL 7 : How to disable IPv6 on a specific interface only
  6. How to recover GRUB (Corrupted boot partition) in CentOS/RHEL 5,6
  7. blastp: command not found
  8. How to restrict ssh logins by user and client address on CentOS/RHEL
  9. Unix file basics : Inode, Soft Vs Hard link, Device files, Named pipes
  10. faketime: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright