How to make Reverse SSH Tunnels secure

439 views Asked by At

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

1

There are 1 answers

0
sloppypasta On

Yes. This is the reason public/private keys exist.