title: WinSCP: Permission denied. Error code: 3 Error message from server: Permission denied
body: <p>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.</p>
  <p>The exact error message:</p>
  <blockquote>
  <p>Cannot create remote file 'var/lib/tomcat6/webapps/..../myfilename.filepart'.<br />
  Permission denied.<br />
  Error code: 3<br />
  Error message from server: Permission denied</p>
  </blockquote>
  <p>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.</p>
  <p>I also tried tweaking some of the  options in the WinSCP preferences such as <em>Drag &amp; Drop</em> and <em>Endurance</em> but nothing made any difference.</p>
  <p>I reinstalled PuTTY and WinSCP, but nothing changed.</p>
  <p>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</p>
  <pre><code>sudo chown myuser:myuser report -R
  </code></pre>
  <p>but my reports will have errors, so I had to type
  <code>sudo chown tomca6:tomcat6 report -R</code> then the error will be cleared and I now can view my replaced file.</p>
  <p>This is very inconvenient as I have to do this every time.
  Is there anything I can do to fix this? thanks</p>