title: Error 13 Permission Denied pysftp library
body: <p><strong>Error 13 Permission Error to a folder.</strong></p>
  <p>I am trying to write a code to upload a document to sftp host using python.
  I am getting the following error <code>[Error 13] Permission Denied</code>. Can you assist, please? I am using Windows 10 Operating System</p>
  <pre class="lang-py prettyprint-override"><code>import pysftp
  
  hostname = &quot;host.com&quot;
  username = &quot;username&quot;
  password = &quot;password&quot;
  
  cnopts = pysftp.CnOpts()
  cnopts.hostkeys = None 
  
  
  with pysftp.Connection(host = hostname, username = username, password = password, cnopts=cnopts) as sftp:
      remoteFilePath = r'\Home\FolderName\file.txt'
      localFilePath = r'C:\Users\user\Desktop\file.txt'
      sftp.put(localFilePath,remoteFilePath)
  </code></pre>
  <p>Here's the error that I am getting:</p>
  <pre class="lang-none prettyprint-override"><code>File &quot;&lt;pyshell#23&gt;&quot;, line 5, in &lt;module&gt;
      sftp.put(localFilePath,remoteFilePath)
    File &quot;C:\Users\user\\AppData\Roaming\Python\Python39\site-packages\pysftp\__init__.py&quot;, line 363, in put
      sftpattrs = self._sftp.put(localpath, remotepath, callback=callback,
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 759, in put
      return self.putfo(fl, remotepath, file_size, callback, confirm)
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 714, in putfo
      with self.file(remotepath, &quot;wb&quot;) as fr:
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 372, in open
      t, msg = self._request(CMD_OPEN, filename, imode, attrblock)
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 813, in _request
      return self._read_response(num)
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 865, in _read_response
      self._convert_status(msg)
    File &quot;C:\Users\user\AppData\Roaming\Python\Python39\site-packages\paramiko\sftp_client.py&quot;, line 896, in _convert_status
      raise IOError(errno.EACCES, text)
  PermissionError: [Errno 13] Permission denied
  </code></pre>