I want to SSH into a remote machine but instead of typing the password, I want to redirect it from another file.
So I have a file password.txt
that stores the password. File.sh
is my bash file.
In File.sh
#!/bin/bash
ssh -T user@10.2.5.1
While executing the file, I did:
./File.sh < password.txt
But I was asked to enter password anyway.
How do I get the password to be input from the file?