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
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.
Use ssh-keygen to create a public key for your machine, then copy your local ~/.ssh/id_rsa.pub
or ~/.ssh/identity.pub
to the remote system, in ~/.ssh/authorized_keys
.
You may need to tighten the permissions on the authorized_keys file: chmod 600