• 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 SFTP Logging without chroot in CentOS/RHEL

by admin

Secure File Transfer Protocol (SFTP) is a great tool for performing secure file transfers. This is a short note to explain how to enable sftp logging without chroot.

1. To enable logging of sftp-server in /var/log/messages, add command-line arguments to the Subsystem sftp line in /etc/ssh/sshd_config

# vi /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server -l VERBOSE

Restart the sshd service for the changes to take effect.

# service sshd restart        # For CentOS/RHEL 6
# systemctl resart sshd       # For CentOS/RHEL 7

2. For logging sftp logs into a different file, configure /etc/ssh/sshd_config using log_facility option and rsyslog to redirect messages into the other file. Edit /etc/ssh/sshd_config and modify as below:

# vi /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server -l VERBOSE -f LOCAL3

and then edit /etc/rsyslog.conf and add the below line:

# vi /etc/rsyslog.conf
local3.* /var/log/sftp.log

Restart sshd and rsyslog service.

# service sshd restart        # For CentOS/RHEL 6
# systemctl restart sshd      # For CentOS/RHEL 7
# service rsyslog restart        # For CentOS/RHEL 6
# systemctl restart rsyslog      # For CentOS/RHEL 7
How to Enable Verbose Logging for VSFTPD

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. debuild: command not found
  2. RHEL 7 – RHCSA Notes : Change passwords and adjust password aging for local user accounts
  3. CentOS / RHEL 7 : How to modify the kernel command line
  4. Nginx load balancing
  5. CentOS / RHEL 5,6 : How to reinstall GRUB loader from rescue mode
  6. Extend volume on non-partitioned disk (XFS) under VMware guest
  7. pkill Command Examples in Linux
  8. isosize: command not found
  9. LVM Configuration : Physical Volume (PV) Operations/Utilities
  10. img2txt Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright