Linux passwordless SSH in to Cisco Devices en

By battler on Tuesday 28 January 2014 10:28 - Comments (3)
Category: Techniek, Views: 6.371

The keys generated by Linux are in an OpenSSH format. Cisco devices don't like this format. Luckily there is a RFC that describes the preferred format for key exchange between different shells (RFC4716). In order to convert a key in Linux to the RFC4716 format:


code:
1
ssh-keygen -e -f id_rsa.pub > Cisco_key.pub



To import this key in Cisco:

code:
1
2
3
4
5
6
R1(config)#ip ssh pubkey-chain 
R1(conf-ssh-pubkey)#username [username]
R1(conf-ssh-pubkey-user)#key-string 
R1(conf-ssh-pubkey-data)#[key]
R1(conf-ssh-pubkey-data)#exit
R1(conf-ssh-pubkey-user)#exit



If someone knows the other way arround (export keys from a Cisco device and import these in to Linux) please share.