For some mysterious reason, Unix/Linux systems guard the mtime very strongly. Only the owner[*] can do what you require, i.e. push the mtime back.
You can't control it with the ACLs (man setfacl
).
One workaround I can think of is to use Samba, that has dos filemode
option. It does exactly what you require (although the name is not very obvious). Of course I'm far from recommending samba over sftp; samba is an administrative nightmare.
In fact, if I were you, I would go for a very, very ugly hack. Write a script that scans sftp-log file for the set ... modtime
line, and for each such line immediately attempt to run touch --mtime
. Obviously, the script needs to run as root, so make sure it is secure from code injection (such as filenames and dates containing ' or " or ; or $ characters).
[*] Actually, also user possessing CAP_FOWNER (such as root), but this is system-wide capability, so not applicable to your case.