summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorAlan Yee <alyee@ucsd.edu>2016-08-01 11:33:05 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-12-05 20:05:39 -0800
commit865bd10d80231ae8457f54c7f98f48892732ecce (patch)
tree63c273a80793689a4fe9de9506c15583dfbcaf46 /README.rst
parent9c3e555001c5f670bd4d48dd6d6f529c1812d3f6 (diff)
downloadparamiko-865bd10d80231ae8457f54c7f98f48892732ecce.tar.gz
Update README.rst
Removing deprecated alias. Updating demo script in the README.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/README.rst b/README.rst
index ab48ed95..54c2a02f 100644
--- a/README.rst
+++ b/README.rst
@@ -86,20 +86,21 @@ Demo
----
Several demo scripts come with Paramiko to demonstrate how to use it.
-Probably the simplest demo of all is this::
+Probably the simplest demo is this::
- import paramiko, base64
- key = paramiko.RSAKey(data=base64.decodestring('AAA...'))
+ import base64
+ import paramiko
+ key = paramiko.RSAKey(data=base64.b64decode(b'AAA...'))
client = paramiko.SSHClient()
client.get_host_keys().add('ssh.example.com', 'ssh-rsa', key)
client.connect('ssh.example.com', username='strongbad', password='thecheat')
stdin, stdout, stderr = client.exec_command('ls')
for line in stdout:
- print '... ' + line.strip('\n')
+ print('... ' + line.strip('\n'))
client.close()
This prints out the results of executing ``ls`` on a remote server. The host
-key 'AAA...' should of course be replaced by the actual base64 encoding of the
+key b'AAA...' should of course be replaced by the actual base64 encoding of the
host key. If you skip host key verification, the connection is not secure!
The following example scripts (in demos/) get progressively more detailed: