Re: bash_logout and sftp
From: Robert L Sowders (rsowders_at_usgs.gov)
Date: 05/06/05
- Previous message: Miller, Matthew: "RE: Bothersome public key SCP implementations.."
- Maybe in reply to: Corey: "bash_logout and sftp"
- Next in thread: Corey: "Re: bash_logout and sftp"
- Reply: Corey: "Re: bash_logout and sftp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
To: Kevin Sullivan <ksulliva@psc.edu> 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
- application/octet-stream attachment: attukf9a.dat
- Previous message: Miller, Matthew: "RE: Bothersome public key SCP implementations.."
- Maybe in reply to: Corey: "bash_logout and sftp"
- Next in thread: Corey: "Re: bash_logout and sftp"
- Reply: Corey: "Re: bash_logout and sftp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]