-2

I wonder if it is possible to chroot/chdir/process the same unix user differently using the ssh key used in the ssh connexion...

The use case could be a rsync server using only one linux/local user for many virtual account.

It's somewhat how github/gitlab manages users.

EDIT: chrooting is not the main point. The point is to differentiate 'virtual' account using the same *nix user but with different SSH keys. Chrooting is a bonus.

PS: I've cooked a quick POC on a F25 server.

1 Answers1

2

I'm not sure if you want different chroots, but the trick is usually to identify the users in authorized_keys. Take this example from Gitolite:

command="/usr/share/gitolite/gl-auth-command john",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAA...

The gl-auth-command then knows who it is, even though everbody signs in with user git.

Halfgaar
  • 8,534