jail-shell icon indicating copy to clipboard operation
jail-shell copied to clipboard

/home/user is empty

Open jaimbh opened this issue 2 years ago • 7 comments

I jailed an already created user using your commands. The /home/user directory has files and directories like public_html, mail, www, ssl, etc. But in the jailed environment, the /home/user directory is empty. I checked that in WinSCP. I want that when I jail user, the home folder should retain all its files and folders.

jaimbh avatar Oct 17 '22 10:10 jaimbh

Try the following configuration:

bind /home/%u /home/ rw,nodev,nosuid

pymumu avatar Oct 17 '22 10:10 pymumu

yes it worked after I added your given command in the jail configuration below: #Base directory binding configuration #Set directory read-only, and prohibit device files bind / ro,nodev,nosuid bind /dev ro,dev,noexec,nosuid bind /home/user /home/user rw,nodev,nosuid

But when I try to open a file inside /home/user through winSCP, I get the below error: Cannot execute SCP to start transfer. Please make sure that SCP is installed on the server and path to it is included in PATH. You may also try SFTP instead of SCP. Command failed with return code 127.

I got this error when I tried opening some files in /home/user. Thanks

jaimbh avatar Oct 28 '22 09:10 jaimbh

You should copy scp command into jail.

clink  /usr/bin/scp /usr/bin/scp

pymumu avatar Oct 28 '22 09:10 pymumu

I want to put 5 users in the same jail. But those users should not be able to access other users' /home directory.

jaimbh avatar Nov 02 '22 06:11 jaimbh

bind /home/%u /home/ rw,nodev,nosuid

%u means user name

pymumu avatar Nov 02 '22 06:11 pymumu

How to give a jailed user access to entire /usr directory using bind mounts? I tried adding "bind /usr /usr ro,nodev,exec,nosuid" in jail conf. It did not work for me.

jaimbh avatar Dec 08 '22 07:12 jaimbh

Bind the entire /usr directory is not supported because the /usr/bin/init program in the jail is required.

pymumu avatar Dec 08 '22 14:12 pymumu