LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 11-26-2012, 12:50 AM   #1
Shashi Kanth
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
How to log the SFTP or SCP transactions on the Server Side?


Hi friends,

I am working on a RHEL 6.2 server in a Data Centre. I have given the SFTP permissions to users and allowed users to transfer files from the Server to client and vice versa.

Here my question is can I log on the server side what files the users are moving to what location on the server? If so, how?

Thanks in advance.

Shashi
 
Old 11-26-2012, 01:38 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

My first suggestion is to go to /var/log/secure. It logs every logging attempts, including SFTP that is first SSH, than underlying file manipulation commands.

That said, I do not how easily you can keep traces (kind of duplication of .history) of an SSH session.
Try to see if you can enforce more logging in /etc/sshd_config.
 
Old 11-26-2012, 08:01 AM   #3
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
In Your /etc/ssh/sshd_config, You may find a line like following

Subsystem sftp /usr/libexec/openssh/sftp-server


Edit this line with following


Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO

Above line will generate INFO level log in /var/log/secure

Thanks
 
Old 11-26-2012, 09:35 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Setting the log level to INFO ought to do the trick. You might also want to modify syslog (or whatever RHEL uses) to sort the sftp log entries to their own file.
 
  


Reply



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
SuSE 11 server - ssh/scp apparently failing at odd times - probable log locations? EnderX Linux - Newbie 3 02-08-2012 07:57 AM
sftp/scp without password chuikingman Linux - Server 9 08-21-2009 06:50 AM
promptless 'do you accept this server key' with scp/sftp helsing Linux - Newbie 4 03-19-2008 12:24 AM
scp vs. sftp Holyninja Linux - Newbie 1 10-29-2007 06:28 PM
scp vs. sftp . . . zthomasz Linux - Security 2 07-08-2003 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration