Python Learning note--paramiko module installation and use (RPM)

Source: Internet
Author: User

Install dependencies First

Yum-y Install GCC

1 Installing Pycrypto

wget http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gztar-xf PYCRYPTO-2.6.TAR.GZCD pycrypto-2.6/ Python setup.py build && python setup.py install
Test, pay attention to case
Python>> Import Crypto

2 Installing Paramiko

wget https://pypi.python.org/packages/2b/27/b64860e7b208ff1dd36fe208d07bca1f9637a11fe733e2f2ceea587c3f75/ Paramiko-1.7.5.zipunzip paramiko-1.7.5.zipcd paramiko-1.7.5python setup.py build && python setup.py install
Test:
Python>> Import Paramiko
Error

/usr/lib64/python2.6/site-packages/crypto/util/randpool.py:40:randompool_deprecationwarning:this Application Uses Randompool, which is broken in older releases. See Http://www.pycrypto.org/randpool-broken
randompool_deprecationwarning)

Open the file and drop the two lines of code:

vim/usr/lib64/python2.6/site-packages/crypto/util/randpool.py

Re-authentication is done by

Python>> Import Paramiko

Telnet

Import paramiko# bind client ssh = Paramiko. Sshclient () Ssh.set_missing_host_key_policy (Paramiko. Autoaddpolicy ()) Ssh.connect ("10.10.10.62", "The Root", "888888") stdin, stdout, stderr = Ssh.exec_command ("/sbin/ Ifconfig ")                    print Stdout.readlines () ssh.close ()

Transferred from: http://www.cnblogs.com/taiguyiba/p/6051022.html

Python Learning note--paramiko module installation and use (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.