Bash: controlling SSH

后端 未结 8 2109
执念已碎
执念已碎 2020-12-03 15:26

I have this bash file, which asks for IP, password, etc. for OpenSSH to a device.

Now, if i use ssh root@ip, i have to enter the password. This is reall

8条回答
  •  孤城傲影
    2020-12-03 16:26

    Many tools to go great lengths to prevent what you are doing. I recommend using ssh public keys to solve this problem instead of passwords.

    The big alternative is to write your own modified ssh client based on the open source so as to take control of the password management.

    Oh, well, I forgot. You can probably outsmart this with a pty, since then /dev/tty will be what you control. expect might help you with this.

提交回复
热议问题