<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: IOS &#8211; Passing commands with ssh</title>
	<atom:link href="http://www.blindhog.net/ios-passing-commands-with-ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blindhog.net/ios-passing-commands-with-ssh/</link>
	<description>Tips and Video Tutorials - Cisco .:. Linux .:. VOIP</description>
	<lastBuildDate>Fri, 30 Jul 2010 13:55:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Josh</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-33158</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Wed, 13 Jan 2010 07:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-33158</guid>
		<description>Everyone, 

Thanks for the tips. 

Josh</description>
		<content:encoded><![CDATA[<p>Everyone, </p>
<p>Thanks for the tips. </p>
<p>Josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Zeke</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32630</link>
		<dc:creator>Rob Zeke</dc:creator>
		<pubDate>Fri, 04 Sep 2009 03:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32630</guid>
		<description>I used to work in a network operations center, and I loved scripting for config changes. I used SecureCRTs fantastic scripting support, and wrote VBScripts, mostly for password changes or config backups or applying a command across all routers. Whats great is that the newer IOS images allow you to upgrade the IOS from the command line, which could easily be worked into a script. I believe its called auto-upgrade manager.</description>
		<content:encoded><![CDATA[<p>I used to work in a network operations center, and I loved scripting for config changes. I used SecureCRTs fantastic scripting support, and wrote VBScripts, mostly for password changes or config backups or applying a command across all routers. Whats great is that the newer IOS images allow you to upgrade the IOS from the command line, which could easily be worked into a script. I believe its called auto-upgrade manager.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamikatze</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32590</link>
		<dc:creator>kamikatze</dc:creator>
		<pubDate>Wed, 19 Aug 2009 20:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32590</guid>
		<description>Cmon&#039; guys don&#039;t ignore the snake ;)

import pexpect
import os

ssh = pexpect.spawn(&quot;ssh user@router&quot;)
ssh.expect(&#039;Password:&#039;)
ssh.sendline(password)
ssh.expect(&#039;Router&gt;&#039;)
ssh.sendline(&#039;show ip bgp summary&#039;)
ssh.expect(&#039;Router&gt;&#039;)
print ssh.before
ssh.close()</description>
		<content:encoded><![CDATA[<p>Cmon&#8217; guys don&#8217;t ignore the snake <img src='http://www.blindhog.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>import pexpect<br />
import os</p>
<p>ssh = pexpect.spawn(&#8220;ssh user@router&#8221;)<br />
ssh.expect(&#8216;Password:&#8217;)<br />
ssh.sendline(password)<br />
ssh.expect(&#8216;Router&gt;&#8217;)<br />
ssh.sendline(&#8216;show ip bgp summary&#8217;)<br />
ssh.expect(&#8216;Router&gt;&#8217;)<br />
print ssh.before<br />
ssh.close()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BungErik</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32565</link>
		<dc:creator>BungErik</dc:creator>
		<pubDate>Sun, 16 Aug 2009 15:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32565</guid>
		<description>You always gave good trick !</description>
		<content:encoded><![CDATA[<p>You always gave good trick !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32458</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Sat, 18 Jul 2009 23:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32458</guid>
		<description>Thanks Ivan! I really need to get into TCL....especially after reading your blog and all the neat things that can be done with it. 


Josh</description>
		<content:encoded><![CDATA[<p>Thanks Ivan! I really need to get into TCL&#8230;.especially after reading your blog and all the neat things that can be done with it. </p>
<p>Josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: monaim</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32445</link>
		<dc:creator>monaim</dc:creator>
		<pubDate>Wed, 15 Jul 2009 21:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32445</guid>
		<description>As Pavel showed,&#039;Expect&#039; should do the trick for automatic login.  By the way, there are ports to other languages specifically python and Ruby for those like me who don&#039;t code in Perl.</description>
		<content:encoded><![CDATA[<p>As Pavel showed,&#8217;Expect&#8217; should do the trick for automatic login.  By the way, there are ports to other languages specifically python and Ruby for those like me who don&#8217;t code in Perl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32436</link>
		<dc:creator>Pavel</dc:creator>
		<pubDate>Tue, 14 Jul 2009 11:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32436</guid>
		<description>#!/usr/bin/perl -w

use strict;

use Expect;

sub scp($$)
{
    my ($from, $to) = @_;

    my $cmd = &quot;scp $login\@$host:/$from $path_input/$to&quot;;
    print $cmd.&quot;\n&quot;;

    my $exp = Expect-&gt;spawn($cmd, ()) or die &quot;Cannot spawn $cmd: $!\n&quot;;

    $exp-&gt;log_stdout($debug);

    $exp-&gt;expect($timeout,
        [ qr/assword:/ =&gt; sub { my $exp = shift; $exp-&gt;send(&quot;$password\n&quot;); exp_continue; } ],
        [ qr/yes\/no\)/ =&gt; sub { my $exp = shift; $exp-&gt;send(&quot;yes\n&quot;); exp_continue; } ],
        [ qr/.+/ =&gt; sub { exp_continue; } ],
        [ &#039;eof&#039; =&gt; sub { return; }],
    );

    my $retVal = $exp-&gt;exitstatus();

    $exp-&gt;soft_close();

    return $retVal;
}</description>
		<content:encoded><![CDATA[<p>#!/usr/bin/perl -w</p>
<p>use strict;</p>
<p>use Expect;</p>
<p>sub scp($$)<br />
{<br />
    my ($from, $to) = @_;</p>
<p>    my $cmd = &#8220;scp $login\@$host:/$from $path_input/$to&#8221;;<br />
    print $cmd.&#8221;\n&#8221;;</p>
<p>    my $exp = Expect-&gt;spawn($cmd, ()) or die &#8220;Cannot spawn $cmd: $!\n&#8221;;</p>
<p>    $exp-&gt;log_stdout($debug);</p>
<p>    $exp-&gt;expect($timeout,<br />
        [ qr/assword:/ =&gt; sub { my $exp = shift; $exp-&gt;send("$password\n"); exp_continue; } ],<br />
        [ qr/yes\/no\)/ =&gt; sub { my $exp = shift; $exp-&gt;send("yes\n"); exp_continue; } ],<br />
        [ qr/.+/ =&gt; sub { exp_continue; } ],<br />
        [ 'eof' =&gt; sub { return; }],<br />
    );</p>
<p>    my $retVal = $exp-&gt;exitstatus();</p>
<p>    $exp-&gt;soft_close();</p>
<p>    return $retVal;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32418</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 09 Jul 2009 21:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32418</guid>
		<description>Hey Josh, 
Glad to see you back online and posting.  I&#039;ve been working on setting up my home lab and watching intently for the next post. I&#039;m not sure about script based config management, but the next thing i wanted to tackle, was working with Rancid for managing cisco IOS config backups.  Im nowhere there yet, but maybe this is something you are interested in...
Really Awesome New Cisco confIg Differ (RANCID)
http://homepage.mac.com/duling/halfdozen/RANCID-Howto.html</description>
		<content:encoded><![CDATA[<p>Hey Josh,<br />
Glad to see you back online and posting.  I&#8217;ve been working on setting up my home lab and watching intently for the next post. I&#8217;m not sure about script based config management, but the next thing i wanted to tackle, was working with Rancid for managing cisco IOS config backups.  Im nowhere there yet, but maybe this is something you are interested in&#8230;<br />
Really Awesome New Cisco confIg Differ (RANCID)<br />
<a href="http://homepage.mac.com/duling/halfdozen/RANCID-Howto.html" rel="nofollow">http://homepage.mac.com/duling/halfdozen/RANCID-Howto.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Pepelnjak</title>
		<link>http://www.blindhog.net/ios-passing-commands-with-ssh/comment-page-1/#comment-32414</link>
		<dc:creator>Ivan Pepelnjak</dc:creator>
		<pubDate>Wed, 08 Jul 2009 15:33:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.blindhog.net/?p=789#comment-32414</guid>
		<description>Configuration changes? Simple ... just write a Tclsh script and execute it with SSH ;)

Automatic login: on a million wish lists, but not implemented.</description>
		<content:encoded><![CDATA[<p>Configuration changes? Simple &#8230; just write a Tclsh script and execute it with SSH <img src='http://www.blindhog.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Automatic login: on a million wish lists, but not implemented.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
