Where is my private key?

Dear all, I am using my home linux distribution to connect to my work’s computer . I know that this connection is done by tunneling where my private ssh key is also used (I configured my computer like that two years ago). Now I need that private key for my windows machine (when I set up the tunneling I have to select my private key). If I am not wrong I should be able to take that private key from my linux machine and use it on my windows one. If that holds true can some one remind me where I can find my private key on my linux machine? I would like to thank you in advance for your reply Regards Alex

  1. Sure, you could copy from your Linux machine, and by default keys
    (public and private) are stored in ~/.ssh (.ssh within your home directory).

  2. You should not do this. Instead create a new public/private keypair
    and then use that key from windows. Transferring private keys from here
    to there is generally not a good idea. How will you transfer it securely?
    Who has access to the windows box? Maybe you’ll do so securely (SCP) to
    a box you control (which nobody else could ever access) but if not then
    you’re giving up access to every system where you have access to anybody
    who can get that key.

I do this a bunch… my primary system has my key to a lot of things, but
any other system I use that needs keys gets a new one. I may grant access
to some systems using that new key by copying it over using my primary
system (due to lack of password-based access, so no easier way to get the
new key onto the box) but otherwise one last password-based authentication
is used to copy the key over, or maybe mailing the public key to the
system administrator for the new system, or something like that.

Why this extra work? Revoking SSH keys from all of the systems you
remember (and the ones you’ve forgotten) is really hard, time-consuming,
painful, etc. Try hard to never need to do that.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Thanks for the answer.
Both operating systems are on the same hard disk :slight_smile: so I will just copy the file from my linux partition to my windows system. That is really safe :slight_smile:

I would only wonder if the same key from different operating system might make the other side to feel “weird” (by other side I mean the network computers I am connecting on)

Regards
Alex

On 03/02/2015 05:06 AM, alaios wrote:
>
> Thanks for the answer.
> Both operating systems are on the same hard disk :slight_smile: so I will just copy
> the file from my linux partition to my windows system. That is really
> safe :slight_smile:

Sure, copying files from Linux to windows should be pretty safe.

Holding those files in windows, as compared to Linux, means your key is
subject to all of the software on the windows side. Good thing windows
never has software that would be undesirable.

> I would only wonder if the same key from different operating system
> might make the other side to feel “weird” (by other side I mean the
> network computers I am connecting on)

SSH servers do not do any interesting checks of clients like clients do of
servers. When a client connects to a server its verification that the
server is who it claims it be is because of the SSH host keys which the
client caches for future connections after you verify (you do verify,
right?) the host manually. The way the server verifies the client is by
its own cache of information, namely username/password, or username/key,
or similar. Multiple simultaneous connections are also fine… SSH
doesn’t care, and the OS just sees multiple logins.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

I copy private keys. I don’t see a problem as long as the computers are secure. Of course, I open an ssh connection (password login) to copy the keys. The private key is encrypted anyway.

I use putty on Windows. It has a different key format, but knows how to convert an openssh key (or it did when I last tried that).