sshj icon indicating copy to clipboard operation
sshj copied to clipboard

"This server does not support operations to modify file attributes."

Open misterouille opened this issue 5 years ago • 1 comments

Hi,

While transfering files through SFTP, we obtain this message from server : "This server does not support operations to modify file attributes."

The "put" command seems to work (we can see the file on the server) but the connexion closes juste after and the sftp.close() cannot be called. We understand that the library tries to modify file attributes (user rights or timestamps ?). Is it possible to prevent sshj from behaving like that ?

Many thanks by advance !

misterouille avatar Dec 02 '20 18:12 misterouille

This happens when preserveAttributes is set to true (the default). You can turn this off with:

final var sftpClient = sshClient.newSFTPClient();
sftpClient.getFileTransfer().setPreserveAttributes(false);

darinmanica avatar Jan 04 '23 15:01 darinmanica