The user account that RStudio Server runs under in the normal course of operations is
rstudio-server. This account is automatically added to the system during installation and is created as a system account rather than end user account (i.e. the --system flag is passed to useradd).
You can configure RStudio Server so that it will run from a different system account with the following steps:
- Create a system user if one doesn't already exist
- Assign this user to the
server-useroption in the
- Delete the log and temporary files associated with RStudio Server.
- Restart RStudio Server
Once completed, you will see that rstudio-server now runs as the new user. For example, if your new user was called
myuser you would run the following commands:
sudo useradd --system myuser
sudo echo 'server-user=myuser' >> /etc/rstudio/rserver.conf
sudo rm -rf /var/log/rstudio-server
sudo rm -rf /var/lib/rstudio-server
sudo rm -rf /tmp/rstudio-rsession
sudo rm -rf /tmp/rstudio-rserver
sudo rstudio-server restart
ps aux | grep myuser
Keep in mind that management tasks performed using the
rstudio-server utility will stay the same even when you change the RStudio Server system account. The
rstudio-server utility enables the stopping, starting, and restarting of the server as well as many other management functions.