keybase / client

Keybase Go Library, Client, Service, OS X, iOS, Android, Electron
BSD 3-Clause "New" or "Revised" License
8.89k stars 1.23k forks source link

KEYBASE_ALLOW_ROOT=1 isn't working #11594

Open bootstraponline opened 6 years ago

bootstraponline commented 6 years ago

image

+ export KEYBASE_ALLOW_ROOT=1
+ KEYBASE_ALLOW_ROOT=1
+ sleep 1
+ keybase service
Oops, you are trying to run as an admin user (Uid: 0). This isn't supported.

What am I doing wrong? I'm using the deb from https://prerelease.keybase.io/keybase_amd64.deb

maxtaco commented 6 years ago

Hmm, seems to work for me, which version are you running?

bootstraponline commented 6 years ago
#!/usr/bin/env bash
set -ex

export KEYBASE_ALLOW_ROOT=1
keybase service &
sleep 1
keybase oneshot

I'm using the prerelease deb.

maxtaco commented 6 years ago

Can you do a keybase version for me?

maxtaco commented 6 years ago

We'll ship a new build today. We had builds paused while we incorporated some big changes. Things are pretty solid mpw, so we're ready to start shipping dailies now.

bootstraponline commented 6 years ago

image

I can't even check the version as root. That's kind of amazing.

espoelstra commented 6 years ago

You should be able to su anyotheruser -c 'keybase version'.

maxtaco commented 6 years ago

Try the most recent release?

bootstraponline commented 6 years ago

I'm at I/O. I'll try it as soon as I get back.

On Wed, May 9, 2018, 9:46 AM Maxwell Krohn notifications@github.com wrote:

Try the most recent release?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/keybase/client/issues/11594#issuecomment-387802526, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHmQTIbxaQqj9e8-xG4MKVxAXGnhBLMks5twx16gaJpZM4Tswjr .

rivy commented 6 years ago

I'm having the same issue with the most recent deb build (2.3.0-20180703160439.fc6ccd458e).

In my case, it appears that a properly set XDG_RUNTIME_DIR is causing the background service to fail with the "Oops, ... admin user ..." error message. Using unset XDG_RUNTIME_DIR allows the service to run.

[user@ubuntu-001 ~]$ keybase version
Client:  2.3.0-20180703160439+fc6ccd458e
[user@ubuntu-001 ~]$ sudo su -
[root@ubuntu-001 ~]$ run_keybase
Oops, you are trying to run as an admin user (Uid: 0). This isn't supported.
[root@ubuntu-001 ~]$
[root@ubuntu-001 ~]$ export KEYBASE_ALLOW_ROOT=1
[root@ubuntu-001 ~]$ unset XDG_RUNTIME_DIR
[root@ubuntu-001 ~]$ run_keybase
Unmounting /root/keybase...
Shutting down kbfsfuse...
Shutting down keybase service...
Failed to connect to bus: No such file or directory
WARNING: Couldn't reach the systemd user-level daemon.
Falling back to non-systemd startup.
Launching keybase service...
Mounting the file system...
Launching Keybase GUI...
Success!
                                                  ▄▄▄▄█▀
╭───────────────────────╮          ▄▄          ▄▄▄█▄▄▀
│                       │         ███▄▄▄▄▄▄▄▄▄▄███▄██
│  Encrypt everything!  │       ▄▄▄████▄▄▄███████████
│                       ├────  ▄▄▄▄▄████▄█████████████
╰───────────────────────╯      ███▄█▄█████████████████▄▄
                                ▀▄███████▄▀ ███████████▄▄
                                  ▄▄▄▄███    ███████████▄▄
                                 ▄████████   ██████████████
                                ▄███▄█████▄▄  ▀▄████████████
                               ███████▄▄██▄█▄▄ █████████████
                              ▄▄█████████████▄▄ ████████████
                           ▄██▄▄████▄▄▄█▄▄█████ ████████████
                                ███▄▄▄▄▄███████▄▄█████████▄▀
                                ▄█████▄▄█████████████▄█████
                                █▄██████████▄▄▄▄▄▄▄███████
                              ▄▄▄▄▄██▄▄█████▄████████████
                            ▀▀▀▀▀▀▀▀▄▄▄▄██▄▀ ▀▀▄▄▄▄▄▄▀▀▀
                                  ▀▀▀▀▀▀▀▀▀
[root@ubuntu-001 ~]$
[root@ubuntu-001 ~]$ export XDG_RUNTIME_DIR=/run/user/0
[root@ubuntu-001 ~]$ run_keybase
▶ INFO Starting keybase.service.
Job for keybase.service failed because the control process exited with error code. See "systemctl --user status key
base.service" and "journalctl -xe" for details.
▶ ERROR Failed to start keybase.service.
▶ ERROR Error in spawning server process: exit status 1
▶ ERROR exit status 1
[root@ubuntu-001 ~]$
[root@ubuntu-001 ~]$ systemctl --user status keybase.service | cat
● keybase.service - Keybase core service
   Loaded: loaded (/usr/lib/systemd/user/keybase.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Jul 04 17:10:35 ubuntu-001 systemd[1652]: Starting Keybase core service...
Jul 04 17:10:35 ubuntu-001 keybase[81540]: Oops, you are trying to run as an admin user (Uid: 0). This isn't suppor
ted.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: keybase.service: Main process exited, code=exited, status=2/INVALIDARGUME
NT
Jul 04 17:10:35 ubuntu-001 systemd[1652]: Failed to start Keybase core service.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: keybase.service: Unit entered failed state.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: keybase.service: Failed with result 'exit-code'.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: keybase.service: Service hold-off time over, scheduling restart.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: Stopped Keybase core service.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: keybase.service: Start request repeated too quickly.
Jul 04 17:10:35 ubuntu-001 systemd[1652]: Failed to start Keybase core service.
[root@ubuntu-001 ~]$
[root@ubuntu-001 ~]$ export XDG_RUNTIME_DIR=
[root@ubuntu-001 ~]$ run_keybase
Unmounting /root/keybase...
Shutting down kbfsfuse...
Shutting down keybase service...
Failed to connect to bus: No such file or directory
WARNING: Couldn't reach the systemd user-level daemon.
Falling back to non-systemd startup.
Launching keybase service...
Mounting the file system...
Launching Keybase GUI...
Success!
                                                  ▄▄▄▄█▀
╭───────────────────────╮          ▄▄          ▄▄▄█▄▄▀
│                       │         ███▄▄▄▄▄▄▄▄▄▄███▄██
│  Encrypt everything!  │       ▄▄▄████▄▄▄███████████
│                       ├────  ▄▄▄▄▄████▄█████████████
╰───────────────────────╯      ███▄█▄█████████████████▄▄
                                ▀▄███████▄▀ ███████████▄▄
                                  ▄▄▄▄███    ███████████▄▄
                                 ▄████████   ██████████████
                                ▄███▄█████▄▄  ▀▄████████████
                               ███████▄▄██▄█▄▄ █████████████
                              ▄▄█████████████▄▄ ████████████
                           ▄██▄▄████▄▄▄█▄▄█████ ████████████
                                ███▄▄▄▄▄███████▄▄█████████▄▀
                                ▄█████▄▄█████████████▄█████
                                █▄██████████▄▄▄▄▄▄▄███████
                              ▄▄▄▄▄██▄▄█████▄████████████
                            ▀▀▀▀▀▀▀▀▄▄▄▄██▄▀ ▀▀▄▄▄▄▄▄▀▀▀
                                  ▀▀▀▀▀▀▀▀▀
rivy commented 6 years ago

Adding Environment=KEYBASE_ALLOW_ROOT=1 to /usr/lib/systemd/user/keybase.service, followed by a killall keybase ; sleep 1; run_keybase, seems to fix the problem for me (without requiring XDG_RUNTIME_DIR to be null).

rivy commented 5 years ago

+ping @maxtaco

This is still a problem (although the same work-arounds work) with the current newest version:

[user@ubuntu-001 ~]$ keybase version
Client:  2.11.0-20181115195458+06d3f3f3c4
DiagonalArg commented 5 years ago

I am also having a similar problem to @rivy, though the XDG_RUNTIME_DIR workaround is not helping, nor is modifying /usr/lib/systemd/user/keybase.service by adding Environment=KEYBASE_ALLOW_ROOT=1. I'm reporting my issue here: https://github.com/keybase/client/issues/14840