Topic "sharing SSH key pairs"

Author Message
[View user's profile]

Joined: 2010-04-28
Posts: 11
Location: UK
I have a problem with re-using my keys for a different user. Question

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:-


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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27083
Location: Prague, Czechia
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.
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License