4

Here is a quick description of what I have done:

I have a chrooted user (username: clientdev) which I have jailed inside their home directory. This chroot directory is /home/clientdev/ which is owned by root.

Now I need this clientdev user to be able access the tomcat web application folder which is residing under /mnt/datadrive/tomcat/webapps.

What I have done is :

  1. chroot the user with a public key of their own to the home directory.
  2. Create a folder under /home/clientdev called tomcat_ROOT and gave the ownership to clientdev.

Now when I run the command :

mount --bind /mnt/datadrive/tomcat/webapps /home/clientdev/tomcat_ROOT

The folder disappears from the directory listing inside /home/clientdev if I login with clientdev. My root user can see it but not the desired user.

Output of ls -l /home/clientdev/tomcat_ROOT:

drwxr-xr-x.  6 root   root    4096 Apr 11 15:07 .   
drwxrwxr-x. 12 root   root    4096 Apr 11 15:07 .. 
drwxr-xr-x.  3 root   root    4096 Apr  9 22:10 webapp1 
drwxr-xr-x.  4 root   root    4096 Mar 18 18:43 webapp2 
drwxr-xr-x.  3 root   root    4096 Apr  9 22:11 webapp3 
drwxrwxr-x. 10 root   root    4096 Apr 11 15:20 ROOT

Output of ls -l /home/clientdev/:

drwx------. 4 clientdev clientdev 4096 Apr 10 21:36 . 
drwxr-xr-x. 7 root      root      4096 Apr 10 22:07 .. 
-rw-------. 1 clientdev clientdev  664 Apr 10 21:43 .bash_history 
-rw-r--r--. 1 clientdev clientdev   18 Apr 23  2012 .bash_logout 
-rw-r--r--. 1 clientdev clientdev  176 Apr 23  2012 .bash_profile 
-rw-r--r--. 1 clientdev clientdev  124 Apr 23  2012 .bashrc 
drwx------. 2 clientdev clientdev 4096 Apr 10 19:20 .ssh
drwxr-xr-x. 2 clientdev clientdev 4096 Apr 10 21:34 tomcat_ROOT

The issue I am having is that when the jailed user uses winscp to connect the the server, they are not able to view the mounted folders.

closed as off-topic by Anthon, slm Jun 30 '14 at 11:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Anthon, slm

  • 3
    Did you restart SSH after it, also are you sure that your client is not caching the directory listing? Some SFTP clients to so make sure to hit Refresh. Your setup seems valid and should work. Also, you should have just posted with same content as in StackOverflow, as now some of the information is in one question, and some is in another. – phoops Apr 15 '14 at 6:32
  • Thank you for the response. I took a look at the caching options in WINSCP and I don't believe that is where the issue is.I also edited the post so that it is more descriptive. – user3513075 Apr 15 '14 at 13:30
  • 1
    Did you really run mount -bind and not mount --bind? Always copy-paste commands and their output. – Gilles 'SO- stop being evil' Apr 15 '14 at 22:31
  • What Linux distribution is this on? Does it use a security framework (e.g. SELinux, Apparmor, …)? – Gilles 'SO- stop being evil' Apr 15 '14 at 22:33
  • The distro is RHEL 4.4.7 with SELinux set to ENFORCING. That is all that it is configured with at the moment. – user3513075 Apr 15 '14 at 22:59

Browse other questions tagged or ask your own question.