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