cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
2863
Views
0
Helpful
1
Replies

Cannot open id_rsa.pub file when trying to set up passwordless ssh

larrycotton
Level 1
Level 1

Hi

I am trying to set up passwordless ssh on a nexus 3524x switch.

I found some instructions to do so here:

https://www.cisco.com/c/en/us/support/docs/voice/mds/200640-Ssh-into-NX-OS-Switches-using-key-based.html

 

To copy the id_rsa.pub key to bootflash (using sftp) they say:

#copy sftp:  bootflash

I do this and enter the required information and it seems to go ok, but when I then try to set the ssh key for the user using this command:

#username <username> sshkey file bootflash:id_rsa.pub

I get an error message: 'cannot open input ssh key file'.

 

When I dir bootflash: I cannot see id_rsa.pub, but when I repeat the copy command thinks there is already a id_rsa.pub file there and asks if I want to overwrite it.

 

Has anyone seen this error before or can see what I am doing wrong ? Am I using the wrong syntax to specify the bootflash ? Does the 'cannot open input ssh key file' mean it cannot find the file, or that it does not have the correct permissions for it ?

 

1 Accepted Solution

Accepted Solutions

larrycotton
Level 1
Level 1

Ok - I was misinterpreting the copy command

I thought

copy stftp: bootflash

meant copy the file I specify to the bootflash: directory to a file of the same name. It seems it actually means copy the file to a file named 'bootflash' (in the bootflash area), so I was looking for the wrong file name. The copy did work and after a rename I now have passwordless login.

 

View solution in original post

1 Reply 1

larrycotton
Level 1
Level 1

Ok - I was misinterpreting the copy command

I thought

copy stftp: bootflash

meant copy the file I specify to the bootflash: directory to a file of the same name. It seems it actually means copy the file to a file named 'bootflash' (in the bootflash area), so I was looking for the wrong file name. The copy did work and after a rename I now have passwordless login.