This question already has an answer here:
- Shell Script for logging into a ssh server 10 answers
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.
#!/bin/bash ssh -T email@example.com
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?