Download your favorite Linux distribution at LQ ISO.
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, 04:33 PM   #1
LQ Newbie
Registered: Mar 2008
Posts: 9

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, 07:06 PM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
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, 06:32 PM   #3
LQ Newbie
Registered: Mar 2008
Posts: 9

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 01: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 12:06 PM
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
SSH / SFTP session logging phatgeezer Linux - Security 2 05-07-2007 11:42 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:55 PM.

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