Update SetModTime failed: SetModTime failed: sftp: “Permission denied” (SSH_FX_PERMISSION_DENIED)

What is the problem you are having with rclone?

Previously: Update SetModTime failed: SetModTime failed: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)

Update SetModTime failed: SetModTime failed: sftp: “Permission denied” (SSH_FX_PERMISSION_DENIED)

What is your rclone version (output from rclone version)


Which OS you are using and how many bits (eg Windows 7, 64 bit)

UnRAID 6.9.1

Which cloud storage system are you using? (eg Google Drive)

N/A - SFTP to a known server

The command you were trying to run (eg rclone copy /tmp remote:tmp)


rclone sync --config .rclone.conf "...path..." Disk3-Remote-Encrypted: --delete-before --transfers=4 --check-first --sftp-set-modtime=false --checkers 4  -P --stats=1m --stats-one-line --buffer-size=64M --log-level DEBUG


rclone sync --config .rclone.conf "...path..." Disk3-Remote-Encrypted: --delete-before --transfers=4 --check-first --sftp-set-modtime=false --checkers 4  -P --stats=1m --stats-one-line --buffer-size=64M --log-level DEBUG

The rclone config contents with secrets removed.

type = crypt
password = BLAH
remote = Remote:/BU/Disk3

type = sftp
user = BLAH
host = BLAH
key_file = BLAH-BLAH
key_file_pass = BLAH
key_use_agent = false
port = BLAH
use_insecure_cipher = false
md5sum_command = none
sha1sum_command = none

A log from the command with the -vv flag

2020/12/19 02:48:24 ERROR : Attempt 3/3 failed with 349 errors and: Update SetModTime failed: SetModTime failed: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)
2020/12/19 02:48:24 Failed to sync with 349 errors: last error was: Update SetModTime failed: SetModTime failed: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)

Following on from solving this...

I've run into another problem due to a solution presented in a previous thread of mine (Update SetModTime failed: SetModTime failed: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED))

So TL;DR, my log was getting full of "...(SSH_FX_PERMISSION_DENIED)" errors and it was suggested that I use --sftp-set-modtime=false.

However, as this then prevented the mod time from being set correctly, rclone continually kept updating the same files (because the local and remote mod times did not match), creating a huge backlog (400GB and 150k files).

Therefore unfortunately I'm back at square one.

I cannot use --sftp-set-modtime=false as this prevents the actual backup from working correctly.

Therefore what commands do I need to use either instead or in combination with --sftp-set-modtime=false such that

A) The modtimes of new files (that don't and will never changed) get set correctly so that when the next backup starts it doesn't upload them all again.

B) Do something with the files that cause the (SSH_FX_PERMISSION_DENIED) errors (either delete and re-upload, silence the error, etc.)

Other than these little hiccups, rclone seems to work perfectly...!!

No one is going to go back and fix an old version. You'd want to report whatever the issue is on the current version and that would be fixed.

The current stable and current betas don't work at all for me (EOF) files.

So 1.53 (and maybe 1.54...) are the only version I can use at the moment...

Edit: I've tested rclone-v1.56.0-beta.5357.b89d085cb, same issue.

Did you open an issue up for the SFTP item? If so, best to follow that issue. If not, I'd open a post on that issue.


Thanks to someone else in my other thread
(Crypt + SFTP - failed to send packet: EOF & Slow!)

they pointed to this:

So they are two separate issues.

I seem to recall some of these issues with too long file names. Could that be happening?

@GA_Badger if you check out the issue above you'll see I've posted a test binary to fix the EOF problems.

Thanks - I'll try that ASAP.

But I'm not sure its relevant for the particular issue in this specific thread (SSH_FX_PERMISSION_DENIED)


It fixes --sftp-set-modtime=false

If your server can't set the modtime then you will need --sftp-set-modtime=false to avoid the error but you'll need to adjust your sync not to use modtimes, so you could use --size-only or --checksum or --update all of which might be good alternatives.

Oh, I see...

To confirm, I want to:

A) Keep newly uploaded files with their correct date/time.
B) Force rclone to upload a newer version of an updated file.

Although as long as rclone uploads the updated file but doesn't necessarily correct the mod time then I can theoretically live with that...


If setting the modtime doesn't work then I think --sftp-set-modtime=false --update should fit your requirements.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.