Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-29-2012, 10:37 AM   #1
LQ Newbie
Registered: Aug 2012
Distribution: CentOS 6.2
Posts: 2

Rep: Reputation: Disabled
SFTP logging for Chroot on CentOS 6.2 with openssh-5.3 not working (internal-sftp)

Hello all, and, thanks in advance for any replies.

I did search for this topic on this forum, and with google. I found some promising information, but, I have not been able to get this to work yet.

I'm hoping for some help getting SFTP logging detail to /var/log/sftp.log, for Chrooted users.

I've been able to get the jailed chroot working, but when I sftp a file, the only logs I see are in the /var/log/secure file, and they only include authentication information, like:

Aug 29 10:07:40 superbadjr sshd[25120]: Accepted password for ...
Aug 29 10:07:40 superbadjr sshd[25120]: pam_unix(sshd:session): session opened for user...
Aug 29 10:07:40 superbadjr sshd[25122]: subsystem request for sftp
Aug 29 10:08:40 superbadjr sshd[25120]: pam_unix(sshd:session): session closed for user...

I would like for the sftp.log file to include the open and close log entries, like:
Aug 28 11:26:20 superbadjr internal-sftp[30116]: open "/var/ftp/sftproot/wegener/status.txt" flags WRITE,CREATE,TRUNCATE mode 0666
Aug 28 11:26:20 superbadjr internal-sftp[30116]: close "/var/ftp/sftproot/wegener/status.txt" bytes read 0 written 293825

Note -- non-chrooted users log to the sftp.log file just fine.

Here's the changes I've made to the /etc/ssh/sshd_config file:
#Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO -f AUTH
Subsystem sftp internal-sftp -l INFO -f AUTH
Match Group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Note - the home directory I'm using for the above "%h" is /var/ftp/sftproot

Here's the changes I've made to /etc/rsyslog.conf: /var/log/sftp.log
# Create an additional socket for some of the sshd chrooted users:
$AddUnixListenSocket /var/ftp/sftproot/dev/log

Note - I did create the /var/ftp/sftproot/dev directory, and, the "log" socket did get created upon restarting the rsyslog service.

If there is any further information I could provide to help, please let me know.

Again, thanks for any replies.
Old 08-30-2012, 07:45 PM   #2
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Shouldn't you set up sockets before you configure where you want to log facility / priority pairs to?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Chroot Jail + SFTP Logging on RHEL / CentOS6 - Logs Not Occuring NDarkstar Red Hat 8 09-07-2013 01:15 AM
Chrooted OpenSSH SFTP server logging issue Sea-you Linux - Server 2 08-03-2011 10:09 PM
internal-sftp logging sshd blither Linux - Server 4 01-12-2011 08:19 PM
OpenSSH 4.7+ chroot-ed SFTP and CentOS 5.3 iSpaZZZ^ Linux - Software 2 06-04-2010 10:51 AM
openssh sftp johnh10000 Linux - Software 1 05-28-2010 04:13 PM > Forums > Linux Forums > Linux - Server

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

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