Hi,<br><br><div class="gmail_quote">2012/1/25 Michael Maymann <span dir="ltr"><<a href="mailto:michael@maymann.org">michael@maymann.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br><br>Heasley+Marito: Thanks for your replies...:-) !<br><br><div class="gmail_quote"><div class="im">2012/1/25 heasley <span dir="ltr"><<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wed, Jan 25, 2012 at 06:03:26PM +0100, Michael Maymann:<br>
<div>> Isn't the "add user..." and "add password..." used for logging in...?<br>
> In my mind I should be able to remove the "add passsword..." line - but<br>
> when I do - I tells me "no password in .cloginrc" or similar (not at work<br>
> currently... so can't give you the specific error...)<br>
<br>
</div>i didnt expect folks to use it without a password/passphrase. they can<br>
be empty strings.<br></blockquote></div><div>Ok. I am using ssh-keysharing without passphrase and therefore no password is needed.<br>In general the "add password..." should not be obligatory when "add identity..." is present. I will try to see if "add password * {} {}" works tomorrow.<br>
</div></div></blockquote><div><br>This works...:-)!<br>I surgest removing obligatory "add password..." when "add identity..." is present. But is still should be an option if someone is using passphrase...<br>
FYI: The error it gives me is:<br>"Error: no password for HOSTNAME in /PATH_TO/.cloginrc."<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_quote"><div>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
> No me either...:-) ! - is it possible from my strace to see where it goes<br>
> wrong, or can I run a specific command for better troubleshooting ?<br>
> Will take a look at cloginrc(5) tomorrow at work...<br>
<br>
</div>clogin -d host<br></blockquote></div><div>I will try this tomorrow as well, and report back with findings. <br></div></div></blockquote><div><br>Now this is my .cloginrc:<br>add method * ssh<br>add user * test<br>add identity * /PATH_TO/.ssh/id_rsa<br>
add password * {} {}<br>add autoenable * {1}<br><br>and the autoenable also did the trick...:-) !<br>"hlogin -c "sh ip" HOSTNAME" now does what i expect...:-) !<br><br>After login, but before running the command specified in "-c" option, it gives me:<br>
HOSTNAME# no page<br>1. What does this mean ?<br><br>2. How do I check if a command i successful or not ?<br><br><br>clogin still fails though, here is the debug output:<br>-bash-3.2$ /usr/libexec/rancid/clogin -d -c "sh ip" hostname<br>
hostname<br>spawn ssh -i /PATH_TO/.ssh/id_rsa -c 3des -x -l user hostname<br>parent: waiting for sync byte<br>parent: telling child to go ahead<br>parent: now unsynchronized from child<br>spawn: returns {22595}<br><br>expect: does "" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no<br>
"(Connection closed by|Connection to [^\n\r]+ closed)"? no<br><br>expect: does "" (spawn_id exp6) match glob pattern "unknown host\r"? no<br><br>expect: does "" (spawn_id exp6) match glob pattern "Host is unreachable"? no<br>
"No address associated with name"? no<br>"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no<br>"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no<br>"Offending key for .* (yes/no)?"? no<br>
"(denied|Sorry)"? no<br>"Login failed"? no<br>"% (Bad passwords|Authentication failed)"? no<br>"Press any key to continue"? no<br>"Enter Selection: "? no<br>"Last login:"? no<br>
"@[^\r\n]+ ([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>"Enter passphrase.*: "? no<br>"(Username|Login|login|user name|User):"? no<br>"([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>
"(>|#| \(enable\))"? no<br>"Login invalid"? no<br>We'd like to keep you up to date about:<br> * Software feature updates<br> * New product announcements<br> * Special events<br><br>Please register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a><br>
<br><br><br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
"(Connection closed by|Connection to [^\n\r]+ closed)"? no<br><br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
<br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
"No address associated with name"? no<br>"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no<br>"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no<br>"Offending key for .* (yes/no)?"? no<br>
"(denied|Sorry)"? no<br>"Login failed"? no<br>"% (Bad passwords|Authentication failed)"? no<br>"Press any key to continue"? no<br>"Enter Selection: "? no<br>"Last login:"? no<br>
"@[^\r\n]+ ([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>"Enter passphrase.*: "? no<br>"(Username|Login|login|user name|User):"? no<br>"([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>
"(>|#| \(enable\))"? no<br>"Login invalid"? no<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
"(Connection closed by|Connection to [^\n\r]+ closed)"? no<br><br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
<br>expect: does "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: <a href="http://www.ProCurve.com">www.ProCurve.com</a>\r\o<br>
"No address associated with name"? no<br>"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no<br>"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no<br>"Offending key for .* (yes/no)?"? no<br>
"(denied|Sorry)"? no<br>"Login failed"? no<br>"% (Bad passwords|Authentication failed)"? no<br>"Press any key to continue"? no<br>"Enter Selection: "? no<br>"Last login:"? no<br>
"@[^\r\n]+ ([Pp]assword|pass<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> ProCurve J8697A Switch 5406zl<br>Software revision K.15.02.0005<br><br>Copyright (C) 1991-2010 Hewlett-Packard Co. All Rights Reserved.<br>
<br> RESTRICTED RIGHTS LEGEND<br><br> Use, duplication, or disclosure by the Government is subject to restrictions<br> as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and<br>
Computer Software clause at 52.227-7013.<br><br> HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303<br><br>expect: set expect_out(buffer) "We'd like to keep you up to date about:\r\n * Software feature updates\r\n * New product announcements\r\n * Special events\r\n\r\nPlease register your products now at: w[<br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>HOSTNAME#<br>expect: does "\u001b[14;1H\u001b[?25h\u001b[46;27H\u001b[?6l\u001b[1;46r\u001b[?7l\u001b[2J\u001b[1;1H\u001b[1;46r\u001b[46;1H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[46;1HHOSTNAME# \uo<br>
"(Connection closed by|Connection to [^\n\r]+ closed)"? no<br><br>expect: does "\u001b[14;1H\u001b[?25h\u001b[46;27H\u001b[?6l\u001b[1;46r\u001b[?7l\u001b[2J\u001b[1;1H\u001b[1;46r\u001b[46;1H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[46;1HHOSTNAME# \uo<br>
<br>expect: does "\u001b[14;1H\u001b[?25h\u001b[46;27H\u001b[?6l\u001b[1;46r\u001b[?7l\u001b[2J\u001b[1;1H\u001b[1;46r\u001b[46;1H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[46;1HHOSTNAME# \uo<br>
"No address associated with name"? no<br>
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no<br>"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no<br>"Offending key for .* (yes/no)?"? no<br>"(denied|Sorry)"? no<br>
"Login failed"? no<br>"% (Bad passwords|Authentication failed)"? no<br>"Press any key to continue"? no<br>"Enter Selection: "? no<br>"Last login:"? no<br>"@[^\r\n]+ ([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>
"Enter passphrase.*: "? no<br>"(Username|Login|login|user name|User):"? no<br>"([Pp]assword|passwd|Enter password for [^ :]+):"? no<br>"(>|#| \(enable\))"? yes<br>expect: set expect_out(0,string) "#"<br>
expect: set expect_out(1,string) "#"<br>expect: set expect_out(spawn_id) "exp6"<br>expect: set expect_out(buffer) "\u001b[14;1H\u001b[?25h\u001b[46;27H\u001b[?6l\u001b[1;46r\u001b[?7l\u001b[2J\u001b[1;1H\u001b[1;46r\u001b[46;1H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b"<br>
send: sending "\r" to { exp6 }<br><br>expect: does " \u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[?25h\u001b[46;11H" (spawn_id exp6) match regular expression "[\r\n]+"? no<br>"^(.+[:.])1 ((>|#| \(enable\)))"? no<br>
"^.+(>|#| \(enable\))"? no<br><br>HOSTNAME#<br>expect: does " \u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[?25h\u001b[46;11H\u001b[46;0H\u001bE\u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[1;46r\u001b[46;1H\u001bo<br>
"^(.+[:.])1 ((>|#| \(enable\)))"? no<br>"^.+(>|#| \(enable\))"? yes<br>expect: set expect_out(0,string) " \u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[?25h\u001b[46;11H\u001b[46;0H\u001bE\u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[1;4"<br>
expect: set expect_out(1,string) "#"<br>expect: set expect_out(spawn_id) "exp6"<br>expect: set expect_out(buffer) " \u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[?25h\u001b[46;11H\u001b[46;0H\u001bE\u001b[46;1H\u001b[46;11H\u001b[46;1H\u001b[2K\u001b[46;1H\u001b[?25h\u001b[46;1H\u001b[1;46r"<br>
send: sending "terminal length 0\r" to { exp6 }<br>couldn't compile regular expression pattern: parentheses () not balanced<br> while executing<br>"expect -nobrace -re { [46;1H([^#>\r\n]+)?[#>](\([^)\r\n]+\))?} {} -re {[<br>
]+} { exp_continue }"<br> invoked from within<br>"expect {<br> -re $reprompt {}<br> -re "\[\n\r]+" { exp_continue }<br> }"<br> (procedure "run_commands" line 21)<br>
invoked from within<br>"run_commands $prompt $command"<br> ("foreach" body line 166)<br> invoked from within<br>"foreach router [lrange $argv $i end] {<br> set router [string tolower $router]<br>
# attempt at platform switching.<br> set platform ""<br> send_user ..."<br> (file "/usr/libexec/rancid/clogin" line 743)<br><br>3. Any idea why this is still causing me problems... ?<br>
<br><br>Thanks in advance :-) !<br>~maymann<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div></div><div class="im">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
> Ok, so you don't think that this is causing me my problems ?<br>
<br>
</div>no<br>
</blockquote></div></div>Super<br><br>Thanks for your help so far...much appreciated...:-) !<span class="HOEnZb"><font color="#888888"><br><br>~maymann<br>
</font></span></blockquote></div><br>