[rancid] Re: SSH Proto 1

john heasley heas at shrubbery.net
Sat Nov 25 04:37:36 UTC 2006


Fri, Nov 24, 2006 at 12:40:29PM +0200, Sotiris Tsimbonis:
> Ian Lists said the following on 24/10/2006 9:53 ??:
> > I have seen some postings online to use the "add sshcmd" line in my .cloginrc file to enable ssh protocol 1 for a device.  I don't see this as one of the avaliable options in the sample .cloginrc file and it didn't seem to work for me anyway.  Could someone give me some tips on getting the ssh "-1" flag to work?
> 
> Use a tiny wrapper for ssh :-)
> 
> $ cat ssh1
> #!/bin/sh
> 
> exec ssh -1 $@
> ###############
> 

Try this patch.

Index: clogin.in
===================================================================
RCS file: /home/rancid/.CVS/rancid/bin/clogin.in,v
retrieving revision 1.102
diff -d -u -r1.102 clogin.in
--- clogin.in	23 Nov 2006 04:20:50 -0000	1.102
+++ clogin.in	25 Nov 2006 04:34:12 -0000
@@ -315,10 +315,11 @@
 	} elseif [string match "ssh*" $prog] {
 	    regexp {ssh(:([^[:space:]]+))*} $prog command suffix port
 	    if {"$port" == ""} {
-		set retval [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ]
-
+		set cmd [join [lindex $sshcmd 0] " "]
+		set retval [ catch {eval spawn [split "$cmd -c $cyphertype -x -l $user $router" { }]} reason ]
 	    } else {
-		set retval [ catch {spawn $sshcmd -c $cyphertype -x -l $user -p $port $router} reason ]
+		set cmd [join [lindex $sshcmd 0] " "]
+		set retval [ catch {eval spawn [split "$cmd -c $cyphertype -x -l $user -p $port $router" { }]} reason ]
 	    }
 	    if { $retval } {
 		send_user "\nError: $sshcmd failed: $reason\n"




More information about the Rancid-discuss mailing list