title: Python script for creating zip file in remote server
body: <p>I want to write a python script that connects to the remote server and creates a zip file in the remote server which consists of specific files present in remote server itself. I have written the below script :</p>
  
  <pre><code>c = paramiko.SSHClient()
  c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  c.connect('15.100.1.1', username='user', password='123')
  sftp=c.open_sftp()
  c.exec_command("cd 'C:\\Program Files\\temp'")
  filenames = ['a.txt','b.txt','c.txt']
  zf = zipfile.ZipFile('files.zip', mode='w')
  for fname in filenames:
      zf.write(fname)
  zf.close()
  sftp.close()
  c.close()
  </code></pre>
  
  <p>But instead of creating zip file in remote server, the zip file gets created in the local machine itself. Can anyone please help me in this.....</p>