r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

RHEL 7 Installation issues #53

Closed nielsenmarkus11 closed 6 years ago

nielsenmarkus11 commented 6 years ago

Okay per the instructions I've installed libsecret via the command: sudo yum install libsecret-devel

Then I installed the keyring and tried to set up the following:

kb <- keyring::backend_secret_service$new()
kb$keyring_create("r-keyring")

At first I got errors that dbus didn't exist... sorry I should have copied the error, but I didn't. The next step I tried installing dbus by doing the following: sudo yum install dbus-x11

Now the error I get is the following:

> library(keyring)
> # Linux
> kb <- keyring::backend_secret_service$new()
> kb$keyring_create("r-keyring")
Error in b_ss_keyring_create_direct(self, private, keyring, password) : 
  Secret service keyring error in 'create_keyring': 'Error spawning command line 'dbus-launch --autolaunch=a1096f06dfd84c9d8d9692d5ad07a9d0 --binary-syntax --close-stderr': Child process exited with code 1'
In addition: Warning message:
In b_ss_keyring_create_direct(self, private, keyring, password) :
  Password ignored, will be read interactively

Any reason you think my install failed? Am I missing some configuration steps?

Thanks.

UPDATE: I've downloaded the development version to get the fix from #43. This is the error I'm seeing now for key_set():

> kb$set(service = "edw",username = Sys.info()['user'],keyring = "r-keyring")
Error in b_ss_set_with_value(self, private, service, username, password,  : 
  Secret service keyring error in 'create_keyring': 'Error spawning command line 'dbus-launch --autolaunch=a1096f06dfd84c9d8d9692d5ad07a9d0 --binary-syntax --close-stderr': Child process exited with code 1'
nielsenmarkus11 commented 6 years ago

Also, as a note the error when I run kb$set(service = "edw",username = Sys.info()['user'],keyring = "r-keyring") or kb$set(service = "edw",username = Sys.info()['user'],keyring = NULL) I get the same error as issue #43 .

nielsenmarkus11 commented 6 years ago

Seems like there may be a bug on RHEL with dbus as shown here. I get the same error when trying to run dbus-launch ... in the terminal:

user@server $ dbus-launch --autolaunch=a1096f06dfd84c9d8d9692d5ad07a9d0 --binary-syntax --close-stderr
Autolaunch error: X11 initialization failed.
nielsenmarkus11 commented 6 years ago

Okay. I think I have pinpointed this issue. I was able to successfully create a keyring and key via ssh in R. However, I typically access R through rstudio-server. X11 doesn't work through rstudio-server.

gaborcsardi commented 6 years ago

Yeah, unfortunately the libsecret backend needs an X11 connection.

nielsenmarkus11 commented 6 years ago

Are there any future plans to make keyring available in the linux/rstudio-server environment? Or is that more of a question for libsecret and whether they'll support input via a non-x11 channel?

gaborcsardi commented 6 years ago

Yes, I don't think it is possible with libsecret. We would need to implement another backend. For example #52 could be of use here, I think.

plroebuck commented 6 years ago

Could use of Xvfb solve this?

wphampton commented 6 years ago

I'm using RHEL Server 7.5 and having similar issues. Is the current understanding that keyring will NOT work on Linux without a GUI -- even using the "env" method? At least through RStudio Server web interface I'm getting messages like argument "keyring" is missing, with no default.

gaborcsardi commented 6 years ago

The env backend should work on all systems. There is also a file backend in a the dev version, coming to CRAN soon. That will also work everywhere.