Ssh-keygen with another user for subversion

I cannot figure out how to create public / private keys for other users on my server. On my server, I type the following through the shell

(uiserver): john:> ssh-keygen -t dsa

After that, I enter the file names and password that successfully result in the private key and a pair of public keys for "john". Now, when I use this key for ssh in my subversion repository (sitting on john), all actions are logged as "john". It's fine.

So, I want to create a public / private key pair for "george" so that it can access my server. I repeated ssh-keygen from my server. Then I gave the secret key to George. George successfully installed the key, but each time he performs an action in the svn repository, subversion records his actions as "john" instead of "george". How to get subversion to recognize the difference between "george" and "john"?

I looked at authorized_keys2, and I noticed that the last comment for both keys is "john @uiserver". I tried to edit the comment, but subversion still cannot recognize the difference between george and john.

Additional Information

I have a semi-working solution based on Giuliano's answer. I went to the david machine (linux), made the prv / pub keys, attached the pub key to john authorized_keys2. Excellent! SVN registers david changes as david.

I went to the george machine (windows xp), used puttygen to create the prv / pub keys, the pub key attached to john authorized_keys2. George can access svn, but all of his changes are still recorded as john. I am trying to use the bojo tunneling solution as soon as I find out where to configure it in TortoiseSVN.

ANSWER

I used option 2 of bojo's answer. In the end, all I had to do was add the following line to my authorized_keys2

command="svnserve -t --tunnel-user=george",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-dss <george long public key> == meaningful comment 

I also added a line

 george=george password 

in my / pathtorepository / conf / passwd to my subversion password file

+4
source share
4 answers

Check out the instructions for using the -tunnel-user command here in svn manual . I assume that the reason George appeared is that John is because you are not talking about the ssh session as it is, so it does not take into account John's account by default.

To clarify, the original poster has two options.

  • Create a new user account for George. This assumes that he has superuser access.
  • Create a second key (ideally, George does this), add John.ssh / authorized_keys to the account file and add the above related commands to the .ssh / authorized_users file as described. The link also describes how to restrict user access to John's account.
+3
source

Then I gave the secret key to George.

Private keys are called private keys for any reason. They are never intended to be transmitted in this way. George must create his own key pair in his own user environment. But this is not related to the problem you are having. Keys are simply the main factors of a really large number (simplified for easy understanding). The user ID is not part of the key, but a β€œlabel” attached to the key, which SSH is not very useful.

From your description, you ask George to log in to John’s account via SSH. What the user who logs into the SVN actions defines is not related to the key pair used for authentication, but to the user who logs in.

So, George should have his own login to enter the SVN server, the repository should share both accounts, and George should use his own credentials to enter the server.

John URL: svn + ssh: // john @ svn-server / path / to / repo

George URL: svn + ssh: // george @ svn-server / path / to / repo

+4
source

Is this related to this SO question , pointing to the svn blog entry over ssh asking for the wrong username ?

The solution was to create a configuration file in the george.ssh directory and paste the following:

 Host uiserver User george 
0
source

You can try:

 ssh-keygen -C "george" 
0
source

All Articles