Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have working jail ssh to one directory.

I would love to give r/w access for the jail ssh user to few directories. For example

  • /tmp/user
  • /home/user
  • /srv/www/user

is that possible?

share|improve this question
up vote 5 down vote accepted

You cannot symlink to anything that is not inside the chroot'ed environment.

I would suggest doing a mount --bind:

(assuming the user's chroot directory is /home/john

mount --bind /tmp/john /home/john/tmp/john
mount --bind /srv/www/john /home/john/srv/www/john
share|improve this answer
sounds good. Let me try that – Radek Nov 22 '10 at 8:21

You can create the directories under /home/user, and then symlink them to the original places. The only problem I see is that the users /tmp will not have the /tmp's noexec.

share|improve this answer
I'm pretty sure you cannot symlink to something that is outside a chroot'ed environment... – Jake Wilson Nov 22 '10 at 6:38
Of course not, I proposed the other way around, create the directory under his chroot and symlink to for example /srv/www/user – 3molo Nov 22 '10 at 7:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.