View the Most Wanted LQ Wiki articles.
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 02-27-2012, 03:33 PM   #1
LQ Newbie
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
Can't get SFTP logging to work

I'm running an SFTP server (openssh). I want to turn on SFTP logging to troubleshoot some issues. From the sftp-server man page, adding "-l INFO" should provide this:

INFO and VERBOSE log transactions that sftp-server performs on behalf of the client.
So I changed my /etc/ssh/sshd_config to read:

Subsystem       sftp    /usr/libexec/openssh/sftp-server -l INFO -f AUTH
and restarted sshd, but I still see "subsystem request for sftp" as the sole log entry when connecting/cd/get/mget with SFTP. I also tried "-l VERBOSE", but no change.

I have not set up a chroot for SFTP, and I doubt it would be the default for CentOS, so I'm not sure what I'm missing. Any ideas?
Old 02-28-2012, 06:06 PM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Were you looking in /var/log/messages? .. it could depend on your syslog config, try using this instead:
Subsystem       sftp    /usr/libexec/openssh/sftp-server -l INFO -e
.. it will dump the logs onto the console instead of into syslog.
Old 03-01-2012, 05:32 PM   #3
LQ Newbie
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the response. I had tried that as well, but saw nothing on the console either. I ended up discovering the problem when I tried logging in as a user that normally doesn't use SFTP. I had set the shell for all "SFTP only" users to "/usr/libexec/openssh/sftp-server", and it appears that the options added to the sshd_config file weren't being read. I changed to internal-sftp (with the logging options) in sshd_config and logging is working now.

Thanks for your response though; sorry for not posting a "never mind, figured it out" response sooner!


centos, logging, sftp

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 12:15 AM
I'm defeated: Can't get SCP to work in chroot jail (but sftp and ssh work fine) ponga Linux - Security 2 09-30-2011 11:06 AM
Chrooted OpenSSH SFTP server logging issue Sea-you Linux - Server 2 08-03-2011 09:09 PM
internal-sftp logging sshd blither Linux - Server 4 01-12-2011 07:19 PM
SSH / SFTP session logging phatgeezer Linux - Security 2 05-07-2007 10:42 AM

All times are GMT -5. The time now is 03:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration