V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
chengxuan
V2EX  ›  Python

求助:如何用 py 修改整段 linux 服务器内文件内容?有神器吗?

  •  
  •   chengxuan · Aug 6, 2014 · 4108 views
    This topic created in 4292 days ago, the information mentioned may be changed or developed.
    我想把一个整段ip下滴 所有linux机器 内某个文件修改。
    请问一下 如何实现。

    例如
    ssh [email protected] - ssh [email protected]
    然后rsa加密 选择 yes
    密码 xxxx
    vi /etc/....
    然后 reboot
    14 replies    2014-08-18 00:21:58 +08:00
    janxin
        1
    janxin  
       Aug 6, 2014   ❤️ 2
    chengxuan
        2
    chengxuan  
    OP
       Aug 6, 2014
    @janxin 还有其他吗?
    ellipse42
        3
    ellipse42  
       Aug 6, 2014   ❤️ 1
    pexpect
    ultimate010
        4
    ultimate010  
       Aug 6, 2014   ❤️ 1
    fabric +1.
    riaqn
        5
    riaqn  
       Aug 6, 2014   ❤️ 1
    expect
    magine
        6
    magine  
       Aug 6, 2014   ❤️ 1
    subprocess

    之前写github webhook 的时候用过,或许对楼主游泳。
    magine
        7
    magine  
       Aug 6, 2014   ❤️ 1
    “游泳”是“有用”,刚才发现打错字了,输入法略难用,抱歉啊。
    est
        8
    est  
       Aug 6, 2014   ❤️ 1
    saltstack
    chengxuan
        9
    chengxuan  
    OP
       Aug 6, 2014
    @magine 感谢 我试试。。哈哈 没事 没事。。。
    clino
        10
    clino  
       Aug 6, 2014   ❤️ 1
    ansible
    superhack
        11
    superhack  
       Aug 7, 2014   ❤️ 1
    fabric + 1
    Zuckonit
        12
    Zuckonit  
       Aug 7, 2014
    fabric + 1
    resettarget
        13
    resettarget  
       Aug 7, 2014   ❤️ 1
    salt, ansible, puppet, chef
    jpuyy
        14
    jpuyy  
       Aug 18, 2014 via iPhone   ❤️ 1
    用Python 的paramiko模块
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   927 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 21:23 · PVG 05:23 · LAX 14:23 · JFK 17:23
    ♥ Do have faith in what you're doing.