0

We have a RHEL server where multiple users have access to it through application. Application RStudio running on these servers default the workspace to the users /home folder. Though there is separate space provided for individual users, users tend to store the files onto /home filling up the /home.

Is there any possibility to restrict users from storing data to their home folders either at server level or R Studio level which would force them to use the provided location?

Though there are options to change the default workspace for all the users, due to the large number of teams each having their sensitive data, it is not possible to have a shared folder as default location.

Note: I have posted it on SO but since it is more into administration, posting it here.

1
  • Why doesn't /home point to the larger space? Do you want users to store certain files in their home directory, but large files such as rstudio in another directory (with different backup or sharing policies)? Sep 8 '21 at 17:00
3

You might just add a quota. In case users tend to work on larger amounts of data, this will make them move quite quickly.

0

You could set home directories permissions to 500, e.g.

sudo chmod 500 /home/*
0

You could create a group without write permissions on home folder and start rstudio through the command sg, which allows you to start it with the group id with reduced permissions.

The ls -l command displays directory contents in long format. The long format contains both permissions and ownership.

# ls -l

With chown you can change owner and group associated to a file/directory (-R == recursive)

# sudo chown -R user01:groupA Directory

By setting the owner and the single group, the others will have restrictions (if set) in accessing files / folders. The chmod command is used to modify the various permissions/restrictions.

# sudo chmod -c ug=rwx,o= file1

going specifically

-c == report if the change is made
u == user
g == group
rwx == read, write, execute
o == others
=null == no permission

For create a new group you can use groupadd

# sudo groupadd rstudiogroup

You will have to set the new group created as the owner of the save destination folder and finally start the software through the command sg

# sudo sg rstudiogroup -c rstudio
1
  • This can't work. If rstudio is running as the logged-in user and the logged-in user owns the home directory, the group permissions won't matter: the user permissions will allow writing. If rstudio is running as a different user from the logged-in user (running setuid or through sudo or equivalent), this is very likely to allow users arbitrary access to other users' files since rstudio is not designed to run with elevated privileges. If the logged-in user doesn't own their home directory, a lot of things are likely to go wrong (including SSH). Sep 8 '21 at 16:59
0

Rstudio Desktop Pro does respect XDG settings as well as it’s own environment variables, but you might want to set some site-wide settings such as some session user settings such as default_project_location, initial_working_directory, and terminal_initial_directory.

For general R stuff, you can set setwd(path) in your startup profile to set a default working directory, although that might break stuff.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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