Python Tutorial
#!/usr/bin/python
import paramiko
HOST = "www.codingpointer.com"
ssh_client = paramiko.SSHClient()
#Add missing client key
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
#connection
ssh_client.connect(HOST,username='heat-admin')
print "SSH connection is established to %s" %HOST
#runs command and reads the output using stdout
stdin, stdout, stderr = ssh_client.exec_command('date')
print stdout.read()
$ python dp-ssh.py SSH connection is established to www.codingpointer.com Fri Feb 16 14:16:22 UTC 2018
Python Tutorial
Privacy Policy | Copyright
2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page