Say, I have an account on my remote server storage
where uses can upload and download data from. I add the SSH key of the allowed users manually to /home/storage/.ssh/authorized_keys
. Now, I have two users that use different public SSH keys, Watson and Sherlock.
How can I make sure that Watson can not upload to/download from Sherlocks private gallery? Is it possible to define file/folder permission based on the SSH key that was used to authenticate?
I thought about a restricted shell program that is set as the storage
user's shell. But how can this restricted shell find out what SSH key was used?