Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/home/user is empty #16

Open
jaimbh opened this issue Oct 17, 2022 · 7 comments
Open

/home/user is empty #16

jaimbh opened this issue Oct 17, 2022 · 7 comments

Comments

@jaimbh
Copy link

jaimbh commented Oct 17, 2022

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.

@pymumu
Copy link
Owner

pymumu commented Oct 17, 2022

Try the following configuration:

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

@jaimbh
Copy link
Author

jaimbh commented Oct 28, 2022

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

@pymumu
Copy link
Owner

pymumu commented Oct 28, 2022

You should copy scp command into jail.

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

@jaimbh
Copy link
Author

jaimbh commented Nov 2, 2022

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

@pymumu
Copy link
Owner

pymumu commented Nov 2, 2022

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

%u means user name

@jaimbh
Copy link
Author

jaimbh commented Dec 8, 2022

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.

@pymumu
Copy link
Owner

pymumu commented Dec 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants