sharing SSH key pairs

Advertisement

jamescollett
Joined:
Posts:
11
Location:
UK

sharing SSH key pairs

I have a problem with re-using my keys for a different user. :?:

I have successfully set up and tested WinSCP/SFTP and SSH and can "put" and "get" between two Windows XP workstations. One of them is acting as an SSH server (with Open SSH) and the other is acting as a WinSCP client.

I have generated a public key file and a private key file. The public key is called "authorized_keys" and is in the folder:-

C:\Documents and Settings\UserOne\SSH\

on the SSH server computer. The private key file is called "privateputtykey.ppk" and is in the folder:-

C:\SFTP\

on the client computer.

I can log in as UserOne from the client computer (using WinSCP) and I can see the contents of the home directory for UserOne on the SSH server.

Now I would like to set up a connection for UserTwo (another user that exists on the computer that is acting as the SSH server). I do not think there was any mention of the username in the process of generating the key pair. So it seemed reasonable to copy the SSH folder, with the file authorized_keys, to the folder C:\Documents and Settings\UserTwo\ on the SSH server computer and to then try to log in from the client as UserTwo, using the same private key. But this just does not work. The error I receive is "Server refused our key".

My question is: Should this approach work? Or have I forgotten something and the key pair that I generated (a while ago now) is somehow associated uniquely with the user "UserOne"?

Many thanks.
Last edited by jamescollett on 2010-05-12 09:03; edited 1 time in total

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: sharing SSH key pairs

It should work. Note that OpenSSH is strict about permissions set for the authorized_keys file and folder it resides in. So make sure it is set the same as for UserOne.

Reply with quote

Advertisement

You can post new topics in this forum