Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: bash_logout and sftp

Subject: Re: bash_logout and sftp
Date: Fri, 6 May 2005 12:30:41 -0700
Why bother?

Why not just set a rapid rsync cron from root and rsync the entire 
structure, and move files with ownership and permission's?  If nothing has 
changed, then nothing gets moved. 

There is something to be said for simple.

rls





Kevin Sullivan <ksulliva@psc.edu>
05/05/2005 03:34 PM

 
        To:     Corey <corey_s@qwest.net>, secureshell@securityfocus.com
        cc: 
        Subject:        Re: bash_logout and sftp


--On 5/1/05 2:56 AM -0700 Corey wrote:
( What I'm trying to get working is to execute user-specific rsync jobs
for  mirroring purposes whenever a user finishes uploading files using
sftp - it  seemed that a .logout sort of rc script would be the easiest
method of doing  this; the only other option I can think of is to use a
log analyzer to grep  for 'session closed for user' msgs )

How disciplined are your users?  Have them create/transfer a dummy 
"/tmp/alldone" file as the last thing they do.  A periodic cron job can 
check for it and if it exists, delete it and run rsync.

Or in sshd_config, replace the sftp line with:
  Subsystem       sftp    /usr/libexec/sftp-server-rsync

And create /usr/libexec/sftp-server-rsync containing:

  #! /bin/sh
  /usr/libexec/sftp-server "$@"
  touch /tmp/alldone >/dev/null 2>&1

Modify as needed depending on where your OS puts sftp-server.  You could 
have this script run the rsync directly but you'd probably get overlapping 

rsync runs and other issues; best not to try.

     -Kevin



Attachment: attukf9a.dat
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>