title: File permissions changed during sftp in paramiko python
body: <p>I am copying a dir and its content recursively from remote to local.
  but i found 755 permission on files has been changed to 644 on local after copy.</p>
  
  <pre><code>    client = paramiko.SSHClient()
      client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      client.connect(hostname, username=uname, password='password')
      sftp = client.open_sftp()
      def copyremotedir(src,dest,sftp):   
          if not os.path.isdir(dest):
              os.makedirs(dest)
  
          for item in sftp.listdir_attr(src):
  
              item_name = str(item.filename)
              if stat.S_ISDIR(item.st_mode):
                  copyremotedir(src + "/" + item_name, dest + "/" + item_name, sftp)
              else:
                  sftp.get(src + "/" + item_name, dest + "/" + item_name)
  </code></pre>