I am in the process of creating a script (lives on computer B) that initiates an ssh tunnel to my computer (computer A). Currently, the script on computer B takes in parameters like IP, port, and whatever else is required to start the ssh tunnel, including the password.
So I use an expect/send script to input the password. However, this is very insecure. So my question is, how can I make this script/process more secure? Are public keys the best way?
Thanks
Yes. This is the reason public/private keys exist.