Provide password to ssh command inside bash script, Without the usage of public keys and Expect

前端 未结 4 947
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 03:08

I want to use SSH inside a script, but this script is not going to be executed on my machine.

In my implementation there are two limitations.

4条回答
  •  长发绾君心
    2021-02-04 03:25

    Install sshpass, then launch the command:

    sshpass -p "yourpassword" ssh -o StrictHostKeyChecking=no yourusername@hostname
    

提交回复
热议问题