paramiko安装及使用

一、基础环境
1、角色、ip、版本、内核
serverA 10.1.10.117 3.2.0-4-amd64 7.8 python pycrypto paramiko ecdsa
python-2.7.3
pycrypto-2.6.1
paramiko-1.15.3
pycrypto-2.6.1.tar.gz
ecdsa-0.13.tar.gz
paramiko-1.15.3.tar.gz
 
二、apt方式安装paramiko
1、安装基础包
apt-get -y install gcc python-dev python-setuptools
 
2、安装pip命令
easy_install pip
 
3、查询下是否有安装的包
1)pip search "pycrypto"
pycrypto             - Cryptographic modules for Python.
2)pip search "paramiko"
paramiko             - SSH2 protocol library
 
4、使用pip方式安装
1)pip install pycrypto
Collecting pycrypto
/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading pycrypto-2.6.1.tar.gz (446kB)
    100% |████████████████████████████████| 446kB 96kB/s 
Installing collected packages: pycrypto
  Running setup.py install for pycrypto
Successfully installed pycrypto-2.6.1
/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
2)pip install paramiko
Collecting paramiko
/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading paramiko-1.15.3-py2.py3-none-any.whl (166kB)
    100% |████████████████████████████████| 167kB 104kB/s 
Collecting ecdsa>=0.11 (from paramiko)
  Downloading ecdsa-0.13-py2.py3-none-any.whl (86kB)
    100% |████████████████████████████████| 90kB 165kB/s 
Requirement already satisfied (use --upgrade to upgrade): pycrypto!=2.4,>=2.1 in /usr/local/lib/python2.7/dist-packages (from paramiko)
Installing collected packages: ecdsa, paramiko
Successfully installed ecdsa-0.13 paramiko-1.15.3

猜你喜欢

转载自blog.csdn.net/saga_gallon/article/details/79196983