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
chengxuan
V2EX  ›  Python

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

  •  
  •   chengxuan · 2014-08-06 20:07:49 +08:00 · 3221 次点击
    这是一个创建于 3522 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我想把一个整段ip下滴 所有linux机器 内某个文件修改。
    请问一下 如何实现。

    例如
    ssh [email protected] - ssh [email protected]
    然后rsa加密 选择 yes
    密码 xxxx
    vi /etc/....
    然后 reboot
    14 条回复    2014-08-18 00:21:58 +08:00
    janxin
        1
    janxin  
       2014-08-06 20:10:19 +08:00   ❤️ 2
    chengxuan
        2
    chengxuan  
    OP
       2014-08-06 20:23:36 +08:00
    @janxin 还有其他吗?
    ellipse42
        3
    ellipse42  
       2014-08-06 20:24:19 +08:00   ❤️ 1
    pexpect
    ultimate010
        4
    ultimate010  
       2014-08-06 20:26:46 +08:00   ❤️ 1
    fabric +1.
    riaqn
        5
    riaqn  
       2014-08-06 20:28:39 +08:00   ❤️ 1
    expect
    magine
        6
    magine  
       2014-08-06 20:33:52 +08:00   ❤️ 1
    subprocess

    之前写github webhook 的时候用过,或许对楼主游泳。
    magine
        7
    magine  
       2014-08-06 20:43:37 +08:00   ❤️ 1
    “游泳”是“有用”,刚才发现打错字了,输入法略难用,抱歉啊。
    est
        8
    est  
       2014-08-06 20:45:11 +08:00   ❤️ 1
    saltstack
    chengxuan
        9
    chengxuan  
    OP
       2014-08-06 20:57:31 +08:00
    @magine 感谢 我试试。。哈哈 没事 没事。。。
    clino
        10
    clino  
       2014-08-06 22:18:55 +08:00   ❤️ 1
    ansible
    superhack
        11
    superhack  
       2014-08-07 00:04:47 +08:00   ❤️ 1
    fabric + 1
    Zuckonit
        12
    Zuckonit  
       2014-08-07 16:36:54 +08:00
    fabric + 1
    resettarget
        13
    resettarget  
       2014-08-07 20:25:36 +08:00   ❤️ 1
    salt, ansible, puppet, chef
    jpuyy
        14
    jpuyy  
       2014-08-18 00:21:58 +08:00 via iPhone   ❤️ 1
    用Python 的paramiko模块
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3265 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 14:15 · PVG 22:15 · LAX 07:15 · JFK 10:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.