Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinSCP: Permission denied. Error code: 3 Error message from server: Permission denied [closed]

I am using WinSCP and keep on experiencing this error every time I try to replace/overwrite a file. I have been able to transfer/overwrite a file before with out any problem but not anymore.

The exact error message:

Cannot create remote file 'var/lib/tomcat6/webapps/..../myfilename.filepart'.
Permission denied.
Error code: 3
Error message from server: Permission denied

I have tried changing the ownership which I was successful at because when I refreshed, from tomcat6, it is now under my login name. But I am still denied. This is giving me a very hard time testing our reports as I just need to see if it's already working i n the deployed app.

I also tried tweaking some of the options in the WinSCP preferences such as Drag & Drop and Endurance but nothing made any difference.

I reinstalled PuTTY and WinSCP, but nothing changed.

I am able to replace my file by coming out 1 notch from the file path (ex. var/lib/myfolder/myproject/web-inf/report, back 1 notch to var/lib/myfolder/myproject/web-inf/) then type

sudo chown myuser:myuser report -R 

but my reports will have errors, so I had to type sudo chown tomca6:tomcat6 report -R then the error will be cleared and I now can view my replaced file.

This is very inconvenient as I have to do this every time. Is there anything I can do to fix this? thanks

like image 831
user742102 Avatar asked Aug 26 '14 12:08

user742102


People also ask

How do I fix permissions denied WinSCP?

To Resolve the issue : Open CLI for the session you have on winscp. Go to the folder path where the file exists. Set the permission to all files under this folder path by using the command below and then try move or delete the file again.

Why is WinSCP Access Denied?

You will get the error while authenticating when: You have entered incorrect password, used non-authorized key, etc. The account you are trying to use cannot be logged in.

How do I fix Sftp permission denied?

To solve the SFTP permission denied error, you'll need to verify that the user account you are using to SFTP has the proper permissions. Then, in the SFTP server, find the file or directory and change ownership or update its permissions.

How do I give permission to a folder in WinSCP?

Other Options. The Add X to directories checkbox makes WinSCP add “execute” permission to directories for every permission group (owner/group/others) where there is a “read” permission set already. On the Properties dialog, the option is available only when there is at least one directory selected.


1 Answers

You possibly do not have create permissions to the folder. So WinSCP fails to create a temporary file for the transfer.

You have two options:

  • Grant write permissions to the folder to the user or group you log in with (myuser), or change the ownership of the folder to the user, or

  • Disable a transfer to temporary file.

    In Preferences, go to Transfer > Endurance page and in Enable transfer resume/transfer to temporary file name for select Disable:

    Prefereces > Transfer > Endurance> Enable transfer resume/transfer to temporary file name > Disable

like image 175
Martin Prikryl Avatar answered Sep 19 '22 14:09

Martin Prikryl