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/bashssh -T user@10.2.5.1While executing the file, I did:./File.sh < password.txtBut I was asked to enter password anyway. How do I get the password to be input from the file? 
Taking password from a file while SSH ing into a machine
ssh;input
SSH with 'password in a file' is commonly used as public key authentication. Create a key pair using ssh-keygen, upload the public key to the other host:scp ./.ssh/id_rsa.pub user@10.2.5.1:~/and place it as ~/.ssh/authorized_keys:ssh user@10.2.5.1mkdir ~/.sshmv ~/id_rsa.pub ~/.ssh/authorized_keysor, if an authorized_keys file already exists:cat ~/id_rsa.pub >> ~/.ssh/authorized_keysset the appropriate permissions (600 for the file, 700 for the directory):chmod 600 ~/.ssh/authorized_keyschmod 700 ~/.sshand start a new ssh session.