V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ml2737150
V2EX  ›  Python

怎么用 Python 登录 ssh 然后获取 ssh 的 banner

  •  
  •   ml2737150 · 2017-12-07 13:18:08 +08:00 · 3121 次点击
    这是一个创建于 2304 天前的主题,其中的信息可能已经有所发展或是发生改变。
    10 条回复    2017-12-08 17:24:39 +08:00
    ml2737150
        1
    ml2737150  
    OP
       2017-12-07 13:18:17 +08:00
    如题
    congminghaoxue92
        2
    congminghaoxue92  
       2017-12-07 13:42:47 +08:00
    ml2737150
        3
    ml2737150  
    OP
       2017-12-07 13:58:15 +08:00
    @congminghaoxue92 大佬 我看过了 没看懂 你能给个例子吗
    julyclyde
        4
    julyclyde  
       2017-12-07 14:06:01 +08:00
    @ml2737150 你也太懒了
    QQ2171775959
        5
    QQ2171775959  
       2017-12-07 14:26:37 +08:00
    老铁,扎心了,自己好好看看吧。。。。学习一下。。
    ml2737150
        6
    ml2737150  
    OP
       2017-12-07 15:07:59 +08:00
    @julyclyde 我主要是看不懂英文 要用翻译软件一点点弄
    cevincheung
        7
    cevincheung  
       2017-12-07 16:07:49 +08:00
    wangxn
        8
    wangxn  
       2017-12-07 19:08:03 +08:00 via Android
    程序员看不懂英文也太说不过去了。
    litter123
        9
    litter123  
       2017-12-07 20:11:26 +08:00
    带上你的 Chrome+Google Tranlate 插件,一次把整个网页译了不就得了
    congminghaoxue92
        10
    congminghaoxue92  
       2017-12-08 17:24:39 +08:00
    from paramiko import SSHClient
    client = SSHClient()
    client.load_system_host_keys()
    client.connect('192.168.2.225',22,'user','passwd')
    stdin, stdout, stderr = client.exec_command('ls -l')
    for line in stdout:
    print('... ' + line.strip('\n'))
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3255 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 10:50 · PVG 18:50 · LAX 03:50 · JFK 06:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.