Set Root folder for rstudio-users on rstudio-server (to hide system folders and files)

Description of issue -
Is there a way of configuring of setting a value in order to disallow the possibility to open files from anywhere in the server.

Currently as a basic user, by putting a "/" in open file option, i can see all the directory tree.
I would like to be able to show only some folders, like user-folders and some specific shared-folders and librairies.

System Information:

  • RStudio Edition: Server
  • RStudio Version: 3.6.0
  • OS Version: Red Hat 7.6
  • R Version:
  • sessionInfo():

Referred here from support.rstudio.com

Hi Aleks,

This is something you can accomplish. In this case, you're actually talking about the permissions of the underling Linux filesystem, so you should adjust those.

Exactly how you want to accomplish that is up to you, but here are a couple of answers from around the web:

4 Likes

Thanks for your fast reply. I figured out the problem was about linux permissions. In the case where i decide to use the Jailkit way, i guess i have to jail rstudio-users only ? My question is, what user is "used" when i got access to all the directory tree in file option of rstudio-server ? I'm not sure if it is the system-user used by the application, or regular rstudio user.
Thank you again.

Hi @Aleks,

The user in the file browser will be the login user. So if you login (for example) as aleks, that'll be the user for the file system.

My problem is that as a basic user, i can navigate and access to all files and directories of the rstudio-server. How can i confine the user to a personal (but custom) folder on rstudio interface ? I'm trying the Jailkit tool, but it would not be enough for what i'm looking for. The scenario i want:
As 'Aleks' user, i'm login in. In file panel, my 'home' folder is visible as root (which means i can't access deeper then the current folder). The second problem is that i want to set the path of this personal folder (instead of the one created at /home/user) . Thank you

So the way that this is typically done is with filesystem permissions. If you make the rest of your filesystem not "world-readable," then the user will not be able to access anything outside of their home directory. I.e. ls / would get Permission denied

Similarly, home directories are customizable per user and stored along with the user profile. So you can make the directory whatever you want, but it will still be the users "home" directory (even if it is at /some/random/path).

Moving / changing home directories is described in this discussion below. Take care when moving a home directory for the user that you are, lest you lose SSH access to the machine.