LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-29-2012, 09:37 AM   #1
RatherBFishin
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:
auth.info /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, 06:45 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,310
Blog Entries: 54

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


Reply


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
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
OpenSSH 4.7+ chroot-ed SFTP and CentOS 5.3 iSpaZZZ^ Linux - Software 2 06-04-2010 09:51 AM
openssh sftp johnh10000 Linux - Software 1 05-28-2010 03:13 PM


All times are GMT -5. The time now is 05:31 PM.

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