git-ssh-server icon indicating copy to clipboard operation
git-ssh-server copied to clipboard

Using server's authorized_keys

Open OmgImAlexis opened this issue 8 years ago • 4 comments

Is it possible to use the authorized_keys file from the current user instead of having a seperate on inside of the config dir?

For example ~/.ssh/authorized_keys

OmgImAlexis avatar Jan 29 '17 15:01 OmgImAlexis

Ah that should be easy enough to implement. It's been a while, but reading my own readme I think we create a keys/authorized_keys file anyway. You can hack this up to either symlink to ~/.ssh/authorized_keys or write a custom authorization implementation. I'd be happy to merge it in, but don't have the time to hack on this myself.

deian avatar Feb 01 '17 00:02 deian

Okay I'll look into it.

OmgImAlexis avatar Feb 01 '17 01:02 OmgImAlexis

Is there a way to add stuff to the config.json without the server overriding it on launch? I need to add something like this. That way if auto is true we use their system file if auto is false we use the path provided. The problem I've got is that every time I launch it config.json gets reset.

 "authorized_keys": {
     "auto": true,
     "path": "~/.ssh/authorized_keys"
 }

OmgImAlexis avatar Feb 04 '17 03:02 OmgImAlexis

Really? Are you passing in arguments that are then used to rewrite the json file?

I think adding another option to modify the sshd_config to not generate authorized_keys file is probably the simpler way to go. This would require changes to the sshd_config template file (in addition). You can temporarily hack this up manually by modifying the sshd_config file to point to your ~/.ssh/authorized_keys file too btw: https://github.com/deian/git-ssh-server/blob/master/templates/sshd_config#L13

deian avatar Feb 06 '17 06:02 deian