How to ssh from within a bash script?

前端 未结 4 887
温柔的废话
温柔的废话 2020-12-07 13:35

I am trying to create an ssh connection and do some things on the remote server from within the script.

However the terminal prompts me for a password, then opens th

4条回答
  •  生来不讨喜
    2020-12-07 13:41

    What you need to do is to exchange the SSH keys for the user the script runs as. Have a look at this tutorial

    After doing so, your scripts will run without the need for entering a password. But, for security's sake, you don't want to do this for root users!

提交回复
热议问题