Skip to content

Instantly share code, notes, and snippets.

@raihanba13
Created November 3, 2019 18:15
Show Gist options
  • Select an option

  • Save raihanba13/d1f43618e83693321e9dceb28dd16c2d to your computer and use it in GitHub Desktop.

Select an option

Save raihanba13/d1f43618e83693321e9dceb28dd16c2d to your computer and use it in GitHub Desktop.
import paramiko
host_name = "****"
user_name = "****"
password = "****"
try:
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=host_name, port=22, username=user_name, password=password)
ftp_client=ssh_client.open_sftp()
ftp_client.put('****/issue_1.docx', '/') #localfilepath , remotefilepath
ftp_client.close()
except Exception as e:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment