How can I automate running commands remotely over SSH to multiple servers in parallel?

前端 未结 20 1606
温柔的废话
温柔的废话 2020-12-12 20:03

I\'ve searched around a bit for similar questions, but other than running one command or perhaps a few command with items such as:

ssh user@host -t sudo su -         


        
20条回答
  •  时光说笑
    2020-12-12 20:39

    Just read a new blog using setsid without any further installation/configuration besides the mainstream kernel. Tested/Verified under Ubuntu14.04.

    While the author has a very clear explanation and sample code as well, here's the magic part for a quick glance:

    #----------------------------------------------------------------------
    # Create a temp script to echo the SSH password, used by SSH_ASKPASS
    #----------------------------------------------------------------------
    SSH_ASKPASS_SCRIPT=/tmp/ssh-askpass-script
    cat > ${SSH_ASKPASS_SCRIPT} <

提交回复
热议问题