Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^8: Send password in Net::SSH::Expect

by Corion (Pope)
on Jan 23, 2020 at 10:28 UTC ( #11111763=note: print w/replies, xml ) Need Help??


in reply to Re^7: Send password in Net::SSH::Expect
in thread Send password in Net::SSH::Expect

Please find below the full output. #ssh-rsa AAAAB3NzaC1yc2 root@HOSTA#gI" /tmp/test.txt']] at ./key.pl li +ne 70.

If that is really, really the (start of the) output of your script, then the hostname (maybe) contains a newline or a carriage return or some other whitespace. Have you really, really checked that your variables contain what you think they do?

If the file contains Windows newlines for example, the output will look as above, as the carriage return left over from the \r\n sequence will move the cursor to the start of the line again.

Replies are listed 'Best First'.
Re^9: Send password in Net::SSH::Expect
by gafaman (Novice) on Jan 23, 2020 at 10:42 UTC
    It is really the (important) part, yes. In full:
    user@host:~/scripts$ ./key.pl Scalar value @hostname_check_arr[1] better written as $hostname_check_ +arr[1] at ./key.pl line 44. Scalar value @words[1] better written as $words[1] at ./key.pl line 50 +. Scalar value @key_check_arr[1] better written as $key_check_arr[1] at +./key.pl line 61. #ssh-rsa AAAAB3NzaC1yc root@EXBOLB4-NO1#gI" /tmp/test.txt']] at ./key. +pl line 70. OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for *
    I have checked the variables and they seem to be fine, do you have any specific code in hand to clear them from that sort annoyance?
        Thanks, I found something:
        :HOSTA\x{0d}:
        Rest seems find. Working on removing this appendix.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11111763]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2020-06-01 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?