Bash Script to SSH into a machine without prompting password and without using keys

后端 未结 2 1476
长情又很酷
长情又很酷 2020-12-10 07:59

I realize this question has been asked a few times but I could not find a relevant answer anywhere in my searching.

I am working in a development environment where s

2条回答
  •  借酒劲吻你
    2020-12-10 08:24

    Use sshpass which is available in package repositories on major Linux-es.

    For example, when password is in password.txt file:

    sshpass -fpassword.txt ssh username@hostname
    

    sshpass runs ssh in a dedicated tty, fooling it into thinking it is getting the password from an interactive user.

提交回复
热议问题