![]() ![]() Here -p represents the Clear Text password Now we are going to use the SSHPASS inside the Shell Script and this time we are going to read the password from the user instead of keeping it in a file How to use SSHPASS inside the Shell Script ( A Secure Approach ) therefore, it is not a recommended approach. Whoever gets access to this password file can get the password as it is a plain text. There is a Security flaw in this approach. you can find that there was no password prompt and we have successfully logged in to the remote server mwivmapp01 ~]$ sshpass -f.passwrdfile ssh mwivmapp02 # Logging into mwivmapp02 from mwivmapp02 using SSHPASS and SSH Step2: Refer the password file in SSHPASS and pass it to SSH. Step1: Create a password file and type in your password as a clear text ( Not a Secure Method ) # Write the password into a file and Save it I have to perform the following steps to log in to the remote server without being prompted or in other words, Make SSH read password from a file using SSHpass SSHPASS command reads the password from a FILE or from STDIN and pass it on to the SSH and SCP command, and thereby preventing the SSH and SCP commands from prompting for a password You should use SSHPASS along with your SSH and SCP commands So, How to connect to SSH or SCP without being prompted for the Password (Terminal) Let us see the same requirement done in the terminal/shell. Yes the objective of this post is to make you able to use SSH and SCP inside the Shell Script and handling the Password prompt without having to create Key based authenticationīefore going to the Shell Script.
0 Comments
Leave a Reply. |