LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   migrating ssh keys (https://www.linuxquestions.org/questions/linux-newbie-8/migrating-ssh-keys-896592/)

kidsin 08-10-2011 12:27 PM

migrating ssh keys
 
Hello,

I need to migrate ssh keys.
I have copied id_rsa & id_rsa.pub to .ssh & permission to 700.
Also, ran ssh-add

However i get error when i connect using ssh

Permission denied (publickey).

What i need to do to resolve this?

EricTRA 08-10-2011 12:35 PM

Hello,

Set permissions to 600 instead of 700 and try again. I've had similar errors with wrongly set permissions on the keys. Both on authorized_keys on the remote side as on the key locally used to connect.

Kind regards,

Eric

kidsin 08-10-2011 12:45 PM

After setting it to 600, the error does not go.

EricTRA 08-10-2011 03:12 PM

Hello,

Can you run the ssh command a bit more verbose:
Code:

ssh -v yoursshcommand (change IP/hosts for privacy please)
Sorry for the delay, had to resolve a problem for a customer.

Kind regards,

Eric

kidsin 08-14-2011 09:08 AM

Sorry, having network problems right now.
Will post the output when my network problem resolves.

EricTRA 08-16-2011 12:37 AM

Hi kidsin,

Any update regarding your problem?

Kind regards,

Eric

kidsin 08-16-2011 01:40 AM

Sorry for the delay.

Here is the ssh -v output: https://gist.github.com/ca42c922f2111e914d76

Also, this might be useful
Code:

ls -l .ssh

-rw------- 1 kidsin kidsin id_rsa
-rw------- 1 kidsin kidsin id_rsa.keystore
-rw------- 1 kidsin kidsin id_rsa.pub
-rw------- 1 kidsin kidsin known_hosts


EricTRA 08-16-2011 01:49 AM

Hello,

Can you post the sshd_config file from the remote server?

Kind regards,

Eric

kidsin 08-16-2011 01:59 AM

No sorry i cant. Why is that needed?
I had migrated the same ssh keys few times in the past and it was working fine. This is sudden, and mostly i am missing something crucial. :(

What did you think of the output? Anything amiss?

EricTRA 08-16-2011 02:05 AM

Hi,

To check the configuration on the remote side (server side) which seems to be rejecting your key. Is the remote server yours? Did someone by any chance delete your key from the authorized_keys file on the remote side?

Kind regards,

Eric

kidsin 08-16-2011 02:20 AM

There is no problem on the remote end. The ssh key are working fine from the old OS. It is just not working on the new OS. (Both the OSes on the same PC, after migration i intend to remove the old OS)

EricTRA 08-16-2011 02:48 AM

Hi,

Did you compare owner and permissions between old OS and the new one? If so, where there any differences?

Kind regards,

Eric

kidsin 08-27-2011 12:09 PM

Yes. i compared the permission setting there are same.
It just wont work.

Migration has stalled as Debian doesnt seem to be stable on my machine. It gets hung unpredictably.


All times are GMT -5. The time now is 11:00 PM.