Quick guide how to set up Rstudio Server Open Source Edition with Google Auth instead Linux PAM.

  1. Download and install rstudio on your machine. Nice guide for Ubuntu/Debian based servers.

  2. Install Google Authenticator PAM module. It’s available on most linux distros. For Ubuntu 20.04 issue command in your terminal.

    sudo apt install libpam-google-authenticator
  3. Configure PAM module.

    sudo cp /etc/pam.d/login /etc/pam.d/rstudio
  4. Comment out line 57 in newly created /etc/pam.d/rstudio file.

    # Standard Un*x authentication.
    #@include common-auth
  5. Generate authentication code for linux user. Guide on ArchWiki.

  6. Install authentication application on your device.

This procedure replace PAM authentication for Rstuidio with OTP (One Time Passwords). Use your linux user name and OTP generated in your app.

I hope this post will be usefull and login for your Rstudio Server more secure.