I need to confine remotely logged in users to stay in 1 directory only, so I would thought I should attack this problem via SFTP or SSH, so I asked in
sshd_config requires each component in the directory path must be owned by root, this requirement is not even possible in our case. So I guess both SSH and SFTP are not the solution.
What other approach can I take to do this task?
PS: After further reading, I think
/bin/bash -r might be the way forward. Not sure if I can set up
ssh to load
/sh/bash -r by default.
PS: Tried to specify
/bin/bash -r in Login Shell field within the user's Advanced Options in Users & Groups. Now the user cannot even login; password prompt keeps returning. In
system.log, I get
PAM: authentication error for illegal user
-r option then the user can log in. I think a bit more config in
/etc/pam.d/sshd will do the job....