I know about RSA authentication, but for my purposes I want to use a heredoc to specify the password I am I want something like the following, but I can not get it to work. Is this also possible?
#! / Bin / bash echo -n "Enter password:" read -s password ssh myhost & lt; & Lt; EOL $ password "Log on to my host" EOL resonated
When I try to do this, this is what it is:
$ ./ Enter testsh password: pseudo terminal will not be allocated because stdin is not a terminal password of user @ myhost: Warning: no xauth data; Using fake authentication data for X11 forwarding Warning: There is no access to TTI (bad file descriptor), so there is no job control in this shell. Mypassword: Command not found. I am logging on my host
Edit:
Based on the BMRG response, I started my script again and came up with the following:
#! / Bin / bash echo -n "Enter Host:" Enter HOST echo -n "Enter User Name:" Enter URL: "U-N" Enter Password: Read- PASS VAR = $ (Hopefully -C " Spon SS $ $ @ $ HOST \ "Send password \" Send \ "$ PASS \ r \" \ "Send \" send \ "ls \ r \" Send \ "resonance 'to' $ HOST ' R \ "expected-re \" stuff \ "send \" logout \ "") echo-e "\ n \ n \ n ========" VAR = "$ VAR" echoed out
Programs that read passwords often refer to often In order to eliminate the / dev / tty, in the case of which, you have the 'expectation' necessary equipment, which will follow a pseudo-TTI.
Comments
Post a Comment