Home Linux Community Forums Linux Distributions Red Hat OpenSSH 5.3 not Locking Files While Uploading

OpenSSH 5.3 not Locking Files While Uploading

Link to this post 29 Mar 11


I have an SSHD server running on Redhat version 5. When uploading a file to the SFTP server, it appears that the file is not locked for edit, read or write. I am able to move, copy, delete the file while it is being uploaded. I see that the vsftpd has the option to enable a parameter "lock_upload_files" so that all uploads will proceed with a write lock on the files being uploaded. Does SFTP have a similar parameter that may work for me?

Link to this post 29 Mar 11

I do not see any option in sshd_config to allow record locking, however I believe that rsync has file locking. Would it be possible for you to utilize rsync over ssh to accomplish your task?

Link to this post 31 Mar 11

This is a "feature" of Unix/Linux systems, that you can move/delete a file opened by another process. The inode to the file does not change, unless you move it to another device/partition, so the changes are preserved. In the case of a delete, the file will not disappear until the application that opened it closes it. Copying the file is a different beast, in that the current state of the file is copied, so it may not capture all the changes made by SFTP while writing.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board