RANCID's fantastic!

Andrew Partan asp at partan.com
Thu Jan 22 00:53:00 UTC 2004


On Thu, Jan 22, 2004 at 11:06:52AM +1100, Andrew Fort wrote:
> add method sw1.popname {telnet:2001}

With a small amount of hacking, rancid could support
	add method sw1.popname {ssh:2001}
as well, so you would be a step closer to sshing to some port on
your terminal server to connect to some device's console.

[I recently turned telnet off in my console servers & started using
ssh instead.  Works nicely & one less use of telnet around here.]

Anyone want to try these changes to clogin to support sshing to a
port?
	--asp

--- clogin.in.orig	Mon Jan 19 20:52:47 2004
+++ clogin.in	Wed Jan 21 19:46:42 2004
@@ -306,8 +306,14 @@
 		send_user "\nError: telnet failed: $reason\n"
 		exit 1
 	    }
-	} elseif ![string compare $prog "ssh"] {
-	    if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+	} 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 ]
+	    } else {
+	        set retval [ catch {spawn $sshcmd -c $cyphertype -x -l $user -p $port $router} reason ]
+	    }
+	    if { $retval } {
 		send_user "\nError: $sshcmd failed: $reason\n"
 		exit 1
 	    }



More information about the Rancid-discuss mailing list