In complex setup where user connected to remote host using authorized private key, there is a .ssh
folder with user settings and keys related to the remote host.
Is it possible to disallow the connected user to read the contents of the .ssh
folder (which is essentially read to allow the current connection) ?
One option that I can imagine (but not yet know to implement) is using modified shell that disallows console access to the folder and also disallows running real shell.
Another - to compose chroot
sandbox on login, but not sure how safe for the purpose it can be.
Any idea appreciated.