Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running rserver without authentication #1663

Closed
riteshkukreja opened this issue Oct 25, 2017 · 4 comments
Closed

Running rserver without authentication #1663

riteshkukreja opened this issue Oct 25, 2017 · 4 comments

Comments

@riteshkukreja
Copy link

I wish to run rserver without authentication. So only one user will be connected to the rserver and no authentication will be made.

I tried running rserver with --auth-none 1

rserver --www-port 9000 --auth-none 1 --auth-validate-users 0

but i am still unable to initialize the client

curl -X POST --form method=client_init http://localhost:9000/rpc/client_init

Response

{"error":{"code":3,"error":null,"message":"Client unauthorized"}}

I want to run rserver using only one user without authentication and without rstudio application. I want to build my own UI that communicate with rserver.
Thanks in advance.

@jmcphers
Copy link
Member

If you don't need a UI and you don't want authentication then RStudio Server is probably not what you want to use (it isn't designed for this use case). If you're looking to build a web front end to some R code, you might be better served by something like Plumber:

https://github.com/trestletech/plumber

Hope this helps! If you want to discuss further we recommend the RStudio community forum:

https://community.rstudio.com/

@riteshkukreja
Copy link
Author

But running the rserver with --auth-none 1 --auth-validate-users 0 should allow me to execute R commands without authenticating user, right?
Let me trim my use case, I wish to execute R commands and get auto completion without authentication.
Is this possible?

@dinvlad
Copy link

dinvlad commented Jun 29, 2018

@riteshkukreja if that helps still, turns out we also need to set system environmental variable USER=rstudio in order for --auth-none 1 to work (no need to set --auth-validate-users 0 btw).

@grisaitis
Copy link

set system environmental variable USER=rstudio in order for --auth-none 1 to work

good advice.

to do this with the systemd service, i needed to modify a few things:

make sure there's an rstudio user on the system:

sudo useradd rstudio
sudo passwd rstudio  # enter some password
sudo mkdir /home/rstudio
sudo chown -R rstudio /home/rstudio/

caution: creating this linux user might mess with RStudio. I have no idea.

add the env variable

sudo systemctl edit rstudio-server

add:

[Service]
Environment="USER=rstudio"

edit the command for the systemd service

# here, add --auth-none 1 on the ExecStart line:
sudo vi /lib/systemd/system/rstudio-server.service
# load these changes
sudo systemctl daemon-reload
# restart rstudio server
sudo systemctl restart rstudio-server
# check logs, if there's an issue
sudo systemctl status rstudio-server

zaro0508 added a commit to zaro0508/packer-rstudio that referenced this issue Jul 10, 2023
Rstudio server on ubuntu 22.04 fails with `ERR_TOO_MANY_REDIRECTS`.
The fix is to bypass the login page by setting some undocumented
configurations[1].

[1] rstudio/rstudio#1663 (comment)
zaro0508 added a commit to Sage-Bionetworks-IT/packer-rstudio that referenced this issue Jul 13, 2023
Rstudio server on ubuntu 22.04 fails with `ERR_TOO_MANY_REDIRECTS`.
The fix is to bypass the login page by setting some undocumented
configurations[1].

[1] rstudio/rstudio#1663 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants