How do I add a photo to my comment or blog entry?
automating username/password when ssh to cisco router
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• RYXI
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

RYXI > Solaris > automating username/password when ssh to cisco router 22 April 2008 00:05:46

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

automating username/password when ssh to cisco router

BertieBigBollox@gmail.com 22 April 2008 00:05:46
 Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

Looks like you can use ssh -l <username> to specify a username but
there doesnt appear to be a way to send the password, so it still
prompts for this.

I understand that if I was ssh to another unix box I could probably
use the 'expects' command and do it this way but I guess its no good
for a cisco router.

At the moment, I've got a file, called commands.txt which contains the
cisco commands. Then my Solaris script runs a command as follows:-

ssh -l user < commands.txt

So basically, once logged in the cisco commands are run automatically.
However, the password is the problem.

Anyone know of any way around this?
Add comment
Gary Mills 16 April 2008 16:17:07 permanent link ]
 In <dccbbdd7-731d-4295­-9250-8aaa853562ca@a­1g2000hsb.googlegrou­ps.com> "BertieBigBollox@gm­ail.com" <BertieBigBollox@gm­ail.com> writes:

Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

I use `kermit' for this purpose. All of the scripting, including the
ssh password, can be done within a kermit script.


--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-
Add comment
Doug McIntyre 16 April 2008 17:21:05 permanent link ]
 "BertieBigBollox@gma­il.com" <BertieBigBollox@gm­ail.com> writes:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

Looks like you can use ssh -l <username> to specify a username but
there doesnt appear to be a way to send the password, so it still
prompts for this.

I understand that if I was ssh to another unix box I could probably
use the 'expects' command and do it this way but I guess its no good
for a cisco router.

(expect, not expects)
Why not? Same exact thing.

Anyway, the tool has already been invented. The easiest thing to do
would probably go get the RANCID package and use the clogin script within.

Otherwise, the cosi-nms.sf.net area has many tools as well for remote access.

Add comment
Dave Uhring 16 April 2008 17:32:50 permanent link ]
 On Wed, 16 Apr 2008 05:12:47 -0700, BertieBigBollox@gma­il.com wrote:

Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

Public key authentication.

As the user on your Solaris system,

ssh-keygen -t rsa

scp $HOME/.ssh/id_rsa.p­ub router:$­HOME/.ssh/a­uthorized_keys

Add comment
Rc 16 April 2008 17:40:20 permanent link ]
 On Apr 16, 2:12pm, "BertieBigBol...@gm­ail.com"
<BertieBigBol...@gm­ail.com> wrote:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

If you know some Perl, the Net::Appliance::Ses­sion module allows you
to do this, plus it has some goodies like changing to "enable" mode
without a lot of expect coding and works transparently over a serial,
telnet or ssh connection.

<http://search.cpan­.org/dist/Net-Applia­nce-Session/>

HTH, Christian

--
rc at networkz dot ch



Add comment
BertieBigBollox@gmail.com 17 April 2008 12:51:57 permanent link ]
 On Apr 16, 2:21pm, Doug McIntyre <mer...@geeks.org> wrote:
"BertieBigBol...@gm­ail.com" <BertieBigBol...@gm­ail.com> writes:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Looks like you can use ssh -l <username> to specify a username but
there doesnt appear to be a way to send the password, so it still
prompts for this.
I understand that if I was ssh to another unix box I could probably
use the 'expects' command and do it this way but I guess its no good
for a cisco router.
(expect, not expects)
Why not? Same exact thing.

OK. I just thought that since I was running ssh, control wouldnt
return to the script running this (and thus go on to the next line
with the expect statement on until the ssh command was all done and
complete?

Dont you need to use 'spawn' or something if doing it this way? Is
this right?
Add comment
BertieBigBollox@gmail.com 17 April 2008 13:10:23 permanent link ]
 On Apr 16, 1:17pm, Gary Mills <mi...@cc.umanitoba­.ca> wrote:
In <dccbbdd7-731d-4295­-9250-8aaa85356...@a­1g2000hsb.googlegrou­ps.com> "BertieBigBol...@gm­ail.com" <BertieBigBol...@gm­ail.com> writes:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
I use `kermit' for this purpose. All of the scripting, including the
ssh password, can be done within a kermit script.
--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

Please correct me I'm wrong but with kermit dont you need a client end
and a server?

Client end (Solaris) would be OK but not sure how'd I'd run a kermit
server on the Cisco router? Of course, if you are able to do this, I'd
be grateful if you dont mind sharing....
Add comment
BertieBigBollox@gmail.com 17 April 2008 13:15:31 permanent link ]
 On Apr 16, 2:32pm, Dave Uhring <daveuhr...@yahoo.c­om> wrote:
On Wed, 16 Apr 2008 05:12:47 -0700, BertieBigBol...@gma­il.com wrote:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Public key authentication.
As the user on your Solaris system,
ssh-keygen -t rsa
scp $HOME/.ssh/id_rsa.p­ub router:$­HOME/.ssh/a­uthorized_keys

OK. Sorry for the ignorance but if I create this key and do as you
suggest, does this mean I can then log into any cisco router without
it asking for a password?

I'll try this of course...
Add comment
Michael Schmarck 17 April 2008 14:26:13 permanent link ]
 BertieBigBollox@gmai­l.com <BertieBigBollox@gm­ail.com> wrote:

On Apr 16, 2:32pm, Dave Uhring <daveuhr...@yahoo.c­om> wrote:
On Wed, 16 Apr 2008 05:12:47 -0700, BertieBigBol...@gma­il.com wrote:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Public key authentication.
As the user on your Solaris system,
ssh-keygen -t rsa
scp $HOME/.ssh/id_rsa.p­ub router:$­HOME/.ssh/a­uthorized_keys
OK. Sorry for the ignorance but if I create this key and do as you
suggest, does this mean I can then log into any cisco router without
it asking for a password?

Yes, that's what it means.

You MIGHT be asked for the passphrase that you assigned to the
SSH key. But if you don't assign a passphrase during ssh-keygen,
then you won't be asked.

Michael
Add comment
Gary Mills 17 April 2008 16:19:32 permanent link ]
 In <6af5ffd1-c89d-486a­-bcb0-af4b0ec976fb@k­37g2000hsf.googlegro­ups.com> "BertieBigBollox@gm­ail.com" <BertieBigBollox@gm­ail.com> writes:

On Apr 16, 1:17=A0pm, Gary Mills <mi...@cc.umanitoba­.ca> wrote:
In <dccbbdd7-731d-4295­-9250-8aaa85356...@a­1g2000hsb.googlegrou­ps.com> "Ber=
tieBigBol...@gmail­.com" <BertieBigBol...@gm­ail.com> writes:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
I use `kermit' for this purpose. =A0All of the scripting, including the
ssh password, can be done within a kermit script.
--
-Gary Mills- =A0 =A0-Unix Support- =A0 =A0-U of M Academic Computing and N=
etworking-

Please correct me I'm wrong but with kermit dont you need a client end
and a server?

Client end (Solaris) would be OK but not sure how'd I'd run a kermit
server on the Cisco router? Of course, if you are able to do this, I'd
be grateful if you dont mind sharing....

No, just the client. Here's an example kermit script. This runs on a
Solaris machine to make an SSH connection to the ELOM console on an
X4150 server. The one command-line parameter is the hostname of the
network management port of that server. The password, XXXXXXXX, in
this example, is embedded in the script.

#!/usr/local/bin/ke­rmit +
SET EXIT WARNING OFF
set host /pty ssh -o 'StrictHostKeyCheck­ing no' -l admin \%1
IF FAIL {
EXIT 1 connection to \%1
}
INPUT 12 {assword: }
IF FAIL {
EXIT 1 password timeout
}
PAUSE 1
OUTPUT XXXXXXXX\{13}
INPUT 20 { \{45}\{62} }
IF FAIL {
EXIT 1 prompt timeout
}
PAUSE 1
OUTPUT start /SP/AgentInfo/Conso­le\{13}
INPUT 48 {\{13}\{10}}
IF FAIL {
EXIT 1 console timeout
}
CONNECT
PAUSE 10
EXIT 1 disconnected

--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-
Add comment
Doug McIntyre 17 April 2008 17:47:30 permanent link ]
 "BertieBigBollox@gma­il.com" <BertieBigBollox@gm­ail.com> writes:
On Apr 16, 2:21=A0pm, Doug McIntyre <mer...@geeks.org> wrote:
"BertieBigBol...@gm­ail.com" <BertieBigBol...@gm­ail.com> writes:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Looks like you can use ssh -l <username> to specify a username but
there doesnt appear to be a way to send the password, so it still
prompts for this.
I understand that if I was ssh to another unix box I could probably
use the 'expects' command and do it this way but I guess its no good
for a cisco router.
(expect, not expects)
Why not? Same exact thing.

OK. I just thought that since I was running ssh, control wouldnt
return to the script running this (and thus go on to the next line
with the expect statement on until the ssh command was all done and
complete?

Dont you need to use 'spawn' or something if doing it this way? Is
this right?

Yes, spawn is the correct way to do this in expect..

spawn ssh ...

expect {
-re "...
-re "...
...
}

But as I said, its already been invented and debugged as the clogin
program as part of the RANCID package (guess what its written in.. :)­

Its pretty self sufficient, you don't need the whole package, although
what RANCID does is pretty nice too.


Add comment
BertieBigBollox@gmail.com 18 April 2008 13:16:35 permanent link ]
 On Apr 17, 10:15am, "BertieBigBol...@gm­ail.com"
<BertieBigBol...@gm­ail.com> wrote:
On Apr 16, 2:32pm, Dave Uhring <daveuhr...@yahoo.c­om> wrote:
On Wed, 16 Apr 2008 05:12:47 -0700, BertieBigBol...@gma­il.com wrote:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Public key authentication.
As the user on your Solaris system,
ssh-keygen -t rsa
scp $HOME/.ssh/id_rsa.p­ub router:$­HOME/.ssh/a­uthorized_keys
OK. Sorry for the ignorance but if I create this key and do as you
suggest, does this mean I can then log into any cisco router without
it asking for a password?
I'll try this of course...

Just noticed - this isnt going to work, is it? You need to send the
authorised key to the router in question.

The router in question is a cisco device, so I dont know how to do
this...
Add comment
Dave Uhring 18 April 2008 17:38:14 permanent link ]
 On Fri, 18 Apr 2008 02:16:35 -0700, BertieBigBollox@gma­il.com wrote:

Just noticed - this isnt going to work, is it? You need to send the
authorised key to the router in question.
The router in question is a cisco device, so I dont know how to do
this...

If you can ssh into the router you can use scp to send the key.
Add comment
Tilman Schmidt 18 April 2008 19:22:25 permanent link ]
 Dave Uhring schrieb:
On Wed, 16 Apr 2008 05:12:47 -0700, BertieBigBollox@gma­il.com wrote:
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.
Public key authentication.

Last I knew, Cisco still didn't support this. Old gripe of mine.
Would be a nice surprise if that was finally fixed, though.

--
Please excuse my bad English/German/Fren­ch/Greek/Cantonese/K­lingon/...
Add comment
Tilman Schmidt 18 April 2008 19:38:58 permanent link ]
 Dave Uhring schrieb:
On Fri, 18 Apr 2008 02:16:35 -0700, BertieBigBollox@gma­il.com wrote:
Just noticed - this isnt going to work, is it? You need to send the
authorised key to the router in question.
The router in question is a cisco device, so I dont know how to do
this...
If you can ssh into the router you can use scp to send the key.

Heh, no. Not if the router runs something non-unixoid like, say ... Cisco IOS.
See:

ts@r2d2:~> ssh gw1 show session
ts@gw1's password:
% No connections opents@r2d2:~>
ts@r2d2:~> scp ~/.ssh/id_dsa.pub gw1:.ssh/authorized­_keys
ts@gw1's password:

ts@r2d2:~> ssh gw1 show session
ts@gw1's password:
% No connections opents@r2d2:~>

The scp command does nothing, it just terminates immediately (as can be seen
from the lack of the progress line), and the router still asks for my
password afterwards.

HTH
T.

--
Please excuse my bad English/German/Fren­ch/Greek/Cantonese/K­lingon/...
Add comment
Dave Uhring 18 April 2008 20:15:49 permanent link ]
 On Fri, 18 Apr 2008 17:38:58 +0200, Tilman Schmidt wrote:
Dave Uhring schrieb:

If you can ssh into the router you can use scp to send the key.
Heh, no. Not if the router runs something non-unixoid like, say ...
Cisco IOS. See:

Just absurd, implementing only part of a well established protocol.


Add comment
Greg Andrews 18 April 2008 22:11:06 permanent link ]
 Dave Uhring <daveuhring@yahoo.c­om> writes:
On Fri, 18 Apr 2008 17:38:58 +0200, Tilman Schmidt wrote:
Dave Uhring schrieb:
If you can ssh into the router you can use scp to send the key.
Heh, no. Not if the router runs something non-unixoid like, say ...
Cisco IOS. See:
Just absurd, implementing only part of a well established protocol.

What's absurd is the assumption that the storage of a public key
must follow the pattern of Unix ssh implmentations on devices that
are not Unix.

Cisco very likely has a method to store the public key for an account
to allow non-password logins. It's probably not adding the key text
to a file in a subdirectory, but something else.

Has anyone consulted the Cisco documentation yet? (I don't have them
in front of me at the moment)

-Greg
--
Do NOT reply via e-mail.
Reply in the newsgroup.
Add comment
Dave Uhring 18 April 2008 22:43:56 permanent link ]
 On Fri, 18 Apr 2008 18:11:06 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:

Just absurd, implementing only part of a well established protocol.
What's absurd is the assumption that the storage of a public key must
follow the pattern of Unix ssh implmentations on devices that are not
Unix.

You are quite right. Cisco is certainly entitled to break generally
accepted protocols.

Add comment
Greg Andrews 18 April 2008 22:58:31 permanent link ]
 Dave Uhring <daveuhring@yahoo.c­om> writes:
On Fri, 18 Apr 2008 18:11:06 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
Just absurd, implementing only part of a well established protocol.
What's absurd is the assumption that the storage of a public key must
follow the pattern of Unix ssh implmentations on devices that are not
Unix.
You are quite right. Cisco is certainly entitled to break generally
accepted protocols.

Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a
file in a filesystem?

-Greg
--
Do NOT reply via e-mail.
Reply in the newsgroup.
Add comment
Dave Uhring 19 April 2008 01:34:38 permanent link ]
 On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:

You are quite right. Cisco is certainly entitled to break generally
accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a file
in a filesystem?

If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key must
be kept someplace.

I suppose that Cisco could, at least theoretically, keep the public key
stored in a condom attached to an RJ45 port : >
Add comment
Richard B. Gilbert 19 April 2008 02:04:29 permanent link ]
 Dave Uhring wrote:
On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
You are quite right. Cisco is certainly entitled to break generally
accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a file
in a filesystem?
If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key must
be kept someplace.
I suppose that Cisco could, at least theoretically, keep the public key
stored in a condom attached to an RJ45 port : >

The last time I looked, routers did not come equipped with disk drives!
No file system! Or, at least, none in the usual sense of the
expression. It does have flash PROM, NVRAM, or some reasonable
facsimile where it can store things like passwords and public or private
keys, configuration info, etc. I think floppy disks have more storage!!

Add comment


Ivan Marsh 19 April 2008 02:21:32 permanent link ]
 On Fri, 18 Apr 2008 18:04:29 -0400, Richard B. Gilbert wrote:

Dave Uhring wrote:
On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
You are quite right. Cisco is certainly entitled to break generally
accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a
file in a filesystem?
If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key
must be kept someplace.
I suppose that Cisco could, at least theoretically, keep the public key
stored in a condom attached to an RJ45 port : >
The last time I looked, routers did not come equipped with disk drives!
No file system! Or, at least, none in the usual sense of the
expression. It does have flash PROM, NVRAM, or some reasonable
facsimile where it can store things like passwords and public or private
keys, configuration info, etc. I think floppy disks have more storage!!

My routers have considerably more storage space than a floppy.

PCMCIA Filesystem Compatibility Matrix and Filesystem Information
http://www.cisco.co­m/en/US/products/hw/­routers/ps341/produc­ts_tech_note09186a00­800a7515.shtml

--
"Remain calm, we're here to protect you!"

Add comment
Greg Andrews 19 April 2008 03:07:41 permanent link ]
 Dave Uhring <daveuhring@yahoo.c­om> writes:
On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
You are quite right. Cisco is certainly entitled to break generally
accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a file
in a filesystem?
If not in a file then where?

In a database, for example. As long as the ssh server code can retrieve
the key when needed, I don't see where the protocol cares what form the
key storage takes.

I'm not saying that would be a *good* place to store a private key, just
that one could be stored there, and it wouldn't be updatable by merely
uploading a file.

-Greg
--
Do NOT reply via e-mail.
Reply in the newsgroup.
Add comment


Tilman Schmidt 19 April 2008 06:04:44 permanent link ]
 Greg Andrews schrieb:
Cisco very likely has a method to store the public key for an account
to allow non-password logins. It's probably not adding the key text
to a file in a subdirectory, but something else.

Sorry to disappoint you but no. Cisco does not support public key
authentication for ssh, period.

Has anyone consulted the Cisco documentation yet? (I don't have them
in front of me at the moment)

Yes, indeed I have.
Add comment
Dave Uhring 19 April 2008 07:18:04 permanent link ]
 On Sat, 19 Apr 2008 04:04:44 +0200, Tilman Schmidt wrote:
Greg Andrews schrieb:
Cisco very likely has a method to store the public key for an account
to allow non-password logins. It's probably not adding the key text to
a file in a subdirectory, but something else.
Sorry to disappoint you but no. Cisco does not support public key
authentication for ssh, period.

LOL! The authors of RFC4252, The Secure Shell (SSH) Authentication
Protocol, which *mandates* public key authentication are T. Ylonen of SSH
Communications Security Corp and C. Lonvick, Ed. of Cisco Systems, Inc.

Add comment


Greg Menke 19 April 2008 09:37:01 permanent link ]
 
"Richard B. Gilbert" <rgilbert88@comcast­.net> writes:
If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key
must be kept someplace.
I suppose that Cisco could, at least theoretically, keep the public
key stored in a condom attached to an RJ45 port : >
The last time I looked, routers did not come equipped with disk drives!
No file system! Or, at least, none in the usual sense of the
expression. It does have flash PROM, NVRAM, or some reasonable
facsimile where it can store things like passwords and public or private
keys, configuration info, etc. I think floppy disks have more storage!!

Even back in the 10baseT days Cisco routers had nvram to which configs
could be saved, plenty of room for keys if they couldn't be stored in
the running-config for some reason.

Gregm
Add comment
Tilman Schmidt 19 April 2008 21:16:07 permanent link ]
 Dave Uhring schrieb:
On Sat, 19 Apr 2008 04:04:44 +0200, Tilman Schmidt wrote:
Greg Andrews schrieb:
Cisco very likely has a method to store the public key for an account
to allow non-password logins. It's probably not adding the key text to
a file in a subdirectory, but something else.
Sorry to disappoint you but no. Cisco does not support public key
authentication for ssh, period.
LOL! The authors of RFC4252, The Secure Shell (SSH) Authentication
Protocol, which *mandates* public key authentication are T. Ylonen of SSH
Communications Security Corp and C. Lonvick, Ed. of Cisco Systems, Inc.

Yes. Sad, isn't it? One of my most longstanding gripes with Cisco. But
technically they do not claim conformance with that RFC, so you can't
sue them for it.

OTOH, RFC4252 is only a bit over two years old, so perhaps there's still
hope.
Add comment
Dave Uhring 19 April 2008 21:57:45 permanent link ]
 On Sat, 19 Apr 2008 19:16:07 +0200, Tilman Schmidt wrote:
Dave Uhring schrieb:

LOL! The authors of RFC4252, The Secure Shell (SSH) Authentication
Protocol, which *mandates* public key authentication are T. Ylonen of SSH
Communications Security Corp and C. Lonvick, Ed. of Cisco Systems, Inc.

OTOH, RFC4252 is only a bit over two years old, so perhaps there's still
hope.

Curiously neither Theo deRaadt's name nor any other name from the OpenBSD
project appears in those documents. Is this another OOXML-like attempt at
establishing a single provider standard?

Add comment
Richard B. Gilbert 20 April 2008 01:51:47 permanent link ]
 Ivan Marsh wrote:
On Fri, 18 Apr 2008 18:04:29 -0400, Richard B. Gilbert wrote:
Dave Uhring wrote:
On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
You are quite right. Cisco is certainly entitled to break generally
accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a
file in a filesystem?
If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key
must be kept someplace.
I suppose that Cisco could, at least theoretically, keep the public key
stored in a condom attached to an RJ45 port : >
The last time I looked, routers did not come equipped with disk drives!
No file system! Or, at least, none in the usual sense of the
expression. It does have flash PROM, NVRAM, or some reasonable
facsimile where it can store things like passwords and public or private
keys, configuration info, etc. I think floppy disks have more storage!!
My routers have considerably more storage space than a floppy.
PCMCIA Filesystem Compatibility Matrix and Filesystem Information

Checking the link shows that Cisco uses the expression "file systems" in
discussing their routers. Prices being what they are, the ONLY Cisco
router that I have any experience with is a CMP2A. It appears to have
been designed for broadband cable on the WAN side and Ethernet on the
LAN side. I salvaged it from a trash can. I have been unable to find
ANY documentation for this beast.

I found some general instructions for "password recovery" that allowed
me to break into it. I haven't seen anything resembling a "file system"
on this one but perhaps I just don't know what to look for!
Add comment
BertieBigBollox@gmail.com 21 April 2008 12:10:32 permanent link ]
 On Apr 18, 4:38pm, Tilman Schmidt <ts-usenet0...@pxne­t.com> wrote:
Dave Uhring schrieb:
On Fri, 18 Apr 2008 02:16:35 -0700, BertieBigBol...@gma­il.com wrote:
Just noticed - this isnt going to work, is it? You need to send the
authorised key to the router in question.
The router in question is a cisco device, so I dont know how to do
this...
If you can ssh into the router you can use scp to send the key.
Heh, no. Not if the router runs something non-unixoid like, say ... Cisco IOS.
See:
ts@r2d2:~> ssh gw1 show session
ts@gw1's password:
% No connections opents@r2d2:~>
ts@r2d2:~> scp ~/.ssh/id_dsa.pub gw1:.ssh/authorized­_keys
ts@gw1's password:
ts@r2d2:~> ssh gw1 show session
ts@gw1's password:
% No connections opents@r2d2:~>
The scp command does nothing, it just terminates immediately (as can be seen
from the lack of the progress line), and the router still asks for my
password afterwards.

Yes, my point exactly. The Cisco box does not have a file system to
SCP a file to anyway? Its not UNIX or anything similar - its Cisco
IOS....
Add comment
BertieBigBollox@gmail.com 21 April 2008 13:06:28 permanent link ]
 On Apr 19, 3:04am, Tilman Schmidt <ts-usenet0...@pxne­t.com> wrote:
Greg Andrews schrieb:
Cisco very likely has a method to store the public key for an account
to allow non-password logins. It's probably not adding the key text
to a file in a subdirectory, but something else.
Sorry to disappoint you but no. Cisco does not support public key
authentication for ssh, period.
Has anyone consulted the Cisco documentation yet? (I don't have them
in front of me at the moment)
Yes, indeed I have.

OK. Thats that then....
Add comment
Tilman Schmidt 21 April 2008 15:55:33 permanent link ]
 BertieBigBollox@gmai­l.com schrieb:
On Apr 18, 4:38 pm, Tilman Schmidt <ts-usenet0...@pxne­t.com> wrote:
[...]
ts@r2d2:~> scp ~/.ssh/id_dsa.pub gw1:.ssh/authorized­_keys
ts@gw1's password:
ts@r2d2:~> ssh gw1 show session
ts@gw1's password:
% No connections opents@r2d2:~>
The scp command does nothing, it just terminates immediately (as can be seen
from the lack of the progress line), and the router still asks for my
password afterwards.
Yes, my point exactly. The Cisco box does not have a file system to
SCP a file to anyway? Its not UNIX or anything similar - its Cisco
IOS....

Actually, this is not true. The Cisco box does have a file system, and it is
accessible via scp. Quote from the Fine Manual ("Cisco IOS Security
Configuration Guide, Release 12.4", chapter "Secure Copy",
http://www.cisco.co­m/en/US/docs/ios/12_­4/secure/configurati­on/guide/hscp.html):­

"Relying on SSH for security, SCP support allows the secure and authenticated
copying of anything that exists in the Cisco IOS File Systems."

The reason the scp command above didn't work is simply that
".ssh/authorized_ke­ys" is not a valid file name in IOS. The IOS file system
contains the software images in flash, pseudo files like "startup-config" and
"running-config", and more. For an introduction, see the document "Using the
Cisco IOS Integrated File System", to be found at
http://www.cisco.co­m/en/US/docs/ios/fun­damentals/configurat­ion/guide/cf_filesys­tem.html
All these can be transferred from and to the box via tftp, ftp, rcp, or scp,
should you feel the need.

But again, all this is beside the point. Even if you would somehow store your
SSH public key in the Cisco IOS file system (no matter if flash, NVRAM, RAM,
or somewhere in the config) that wouldn't achieve anything, because the SSH
implementation in IOS just won't use it. This too can be found in the Fine
Manual, chapter "Configuring Secure Shell" this time
(http://www.cisco.c­om/en/US/docs/ios/12­_4/secure/configurat­ion/guide/schssh.htm­l)
which has the following to say, under the aptly named heading "Restrictions":

"RSA authentication available in SSH clients is not supported in the SSH
server for Cisco IOS software."

Sad, but true. And no change in sight.

HTH
T.

--
Please excuse my bad English/German/Fren­ch/Greek/Cantonese/K­lingon/...
Add comment
Ivan Marsh 22 April 2008 00:05:46 permanent link ]
 On Sat, 19 Apr 2008 17:51:47 -0400, Richard B. Gilbert wrote:

Ivan Marsh wrote:
On Fri, 18 Apr 2008 18:04:29 -0400, Richard B. Gilbert wrote:
Dave Uhring wrote:
On Fri, 18 Apr 2008 18:58:31 +0000, Greg Andrews wrote:
Dave Uhring <daveuhring@yahoo.c­om> writes:
You are quite right. Cisco is certainly entitled to break
generally accepted protocols.
Perhaps you and I are talking about different things. I would agree
that a previous poster's description of scp failure is a bad thing.
However, I've been talking about the storage of a public key. Which
part of the SSH protocol says that public key storage must be in a
file in a filesystem?
If not in a file then where? RFC4252 states that public key
authentication is *required* in any SSH implementation and that key
must be kept someplace.
I suppose that Cisco could, at least theoretically, keep the public
key stored in a condom attached to an RJ45 port : >
The last time I looked, routers did not come equipped with disk
drives!
No file system! Or, at least, none in the usual sense of the
expression. It does have flash PROM, NVRAM, or some reasonable
facsimile where it can store things like passwords and public or
private keys, configuration info, etc. I think floppy disks have more
storage!!
My routers have considerably more storage space than a floppy.
PCMCIA Filesystem Compatibility Matrix and Filesystem Information
Checking the link shows that Cisco uses the expression "file systems" in
discussing their routers. Prices being what they are, the ONLY Cisco
router that I have any experience with is a CMP2A. It appears to have
been designed for broadband cable on the WAN side and Ethernet on the
LAN side. I salvaged it from a trash can. I have been unable to find
ANY documentation for this beast.

Trash Cisco... good deal.

I found some general instructions for "password recovery" that allowed
me to break into it. I haven't seen anything resembling a "file system"
on this one but perhaps I just don't know what to look for!

If it has NVRAM it has a filesystem... that doesn't necessarily mean you
have access to that filesystem.

--
"Remain calm, we're here to protect you!"

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


RYXI > Solaris > automating username/password when ssh to cisco router 22 April 2008 00:05:46

see also:
Sculpt Spell Possible Broke-ness
Historical Sales Figures for D&D's…
rec.games.frp.dnd FAQ list thing?
пройди тесты:
see also:
The Environement man !

  Copyright © 2001—2008 RYXI
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.ryxi.com.
Сообщения об ошибках оставляем в сообществе bugs.ryxi.com.
Предложения и комментарии пишем в сообществе suggest.ryxi.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .