[j-nsp] Setting SSH keys?

Harry Reynolds harry at juniper.net
Thu Sep 8 23:12:43 EDT 2005


Hmmm. I have heard of buffer problems when pasting long files into the
cli, so you might try saving the key as a file and doing a load merge
(example below). However, I was able to paste a ssh-rsa key via an ssh
session to a remote router running 6.4:

[edit system login user test]
lab at foo# show 
uid 2007;
class superuser;

[edit system login user test]
lab at foo# set authentication ssh-rsa "1024 65537
14507521839282798432482521835
...231170906047985814682544941905107416839803283 root" 

<<< Note the quotes around the key    

[edit system login user test]
lab at foo# show 
uid 2007;
class superuser;
authentication {
    ssh-rsa "1024 65537
145075218392827984324825218350230553263814016634520586690808864914655447
007843928111405582237619829072232066626802021176342985734845637869610319
998691546196249435479692894437417780898017483440313841107367122670080439
972894195679320796753410731222833899141869327583231170906047985814682544
941905107416839803283 root"; ## SECRET-DATA
}


<<< Here is a load merge example. Note the file with the key is edited
with the correct brackety stuff:

[edit system login user test]
lab at foo# delete authentication 

[edit system login user test]
lab at foo# show 
uid 2007;
class superuser;

[edit system login user test]
lab at foo# run file show key 
authentication {
    ssh-rsa "1024 65537
145075218392827984324825218350230553263814016634520586690808864914655447
007843928111405582237619829072232066626802021176342985734845637869610319
998691546196249435479692894437417780898017483440313841107367122670080439
972894195679320796753410731222833899141869327583231170906047985814682544
941905107416839803283 root";
}
 
<<< Note the added "authentication {
				ssh-rsa" 
bit, and the trailing "{"

[edit system login user test]
lab at foo# load merge relative key 
load complete

<<< use relative to inherit current config hierarchy.

[edit system login user test]
lab at foo# show 
uid 2007;
class superuser;
authentication {
    ssh-rsa "1024 65537
145075218392827984324825218350230553263814016634520586690808864914655447
007843928111405582237619829072232066626802021176342985734845637869610319
998691546196249435479692894437417780898017483440313841107367122670080439
972894195679320796753410731222833899141869327583231170906047985814682544
941905107416839803283 root"; ## SECRET-DATA
}


[edit system login user test]
lab at foo# commit check 
configuration check succeeds

HTHs


> -----Original Message-----
> From: juniper-nsp-bounces at puck.nether.net 
> [mailto:juniper-nsp-bounces at puck.nether.net] On Behalf Of Joe McGuckin
> Sent: Thursday, September 08, 2005 7:44 PM
> To: juniper-nsp at puck.nether.net
> Subject: [j-nsp] Setting SSH keys?
> 
> What's an easy way to transfer a ssh-rsa key from one router 
> to another?
> Cutting and pasting the multi-line key text isn't working for me...
> 
> Joe
> 
> -- 
> 
> Joe McGuckin
> 
> ViaNet Communications
> 994 San Antonio Road
> Palo Alto, CA  94303
> 
> Phone: 650-213-1302
> Cell:  650-207-0372
> Fax:   650-969-2124
> 
> 
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net 
> http://puck.nether.net/mailman/listinfo/juniper-nsp
> 



More information about the juniper-nsp mailing list