Keybase filesystem


How to use KBFS (Keybase filesystem) on FreeBSD?

/!\ There is a kbfsd daemon available in ports now, which automates all those steps.

We assume here that you've got a Keybase account and you are already logged in. We use beastie as a username of your non-root user account.

  1. Install security/keybase.

  2. Add your user to the opearator group:

    # pw groupmod operator -m beastie

    Otherwise you are going to get /dev/fuse: Permission denied. Also you might need to log out and log in after adding your user to the operator group.

  3. Create keybased.sock. It could be done by simply asking the Keybase client to interact with KBFS somehow. Although the following command fails because KBFS is not mounted just yet it configures the system to be ready to mount KBFS.

    $ keybase fs ls /keybase
  4. Configure FUSE:
    1. Load the FUSE filesystem kernel module:
      # kldload fuse
    2. Make it possible to mount FUSE volumes as a non-root user:
      # sysctl vfs.usermount=1
  5. Prepare your system to mount your Keybase volume.
    # mkdir -p /keybase
    # chown beastie /keybase
  6. Run kbfsfuse:
    $ kbfsfuse /keybase
    You should get an output like this:
    ▶ INFO KBFS version 1.0.2
    ▶ WARNING adding NotifyService protocol
    ▶ INFO | net.Listen on unix:/home/beastie/.config/keybase/kbfsd.sock
    ▶ INFO OnConnect called with a new connection
    ▶ INFO authentication successful; ping interval: 30s
    ▶ INFO authentication successful; ping interval: 30s
    ▶ INFO MDServerRemote: auth token refreshed
    ▶ INFO Mounting the filesystem was a success
    ▶ INFO Created new folder-branch for 1e163a1a3bb7d37a20eabc130d015406 [tags:FID=XNhXFtI-T6rksgAAGdI7Fg]
    You have to leave your terminal open running kbfsfuse. If you stop the program, the KBFS volume is unmounted.


Troubleshooting


""dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory"; retrying in 2s"

When I run kbfsfuse /keybase as root or sudo kbfsfuse /keybase I get the following error messages:

▶ INFO KBFS version 1.0.2
▶ WARNING (CONN KeybaseDaemonRPC ebdc0ab8) Connection: error dialing transport: dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory
▶ WARNING KeybaseDaemonRPC: connection error: "dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory"; retrying in 2s
▶ WARNING (CONN CryptoClient c9e050c7) Connection: error dialing transport: dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory
▶ WARNING CryptoClient: connection error: "dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory"; retrying in 2s
▶ INFO | net.Listen on unix:/root/.config/keybase/kbfsd.sock
▶ INFO OnConnect called with a new connection
▶ WARNING (CONN KeybaseDaemonRPC ebdc0ab8) Connection: error dialing transport: dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory
▶ WARNING KeybaseDaemonRPC: connection error: "dial unix /root/.config/keybase/keybased.sock: connect: no such file or directory"; retrying in 2s
▶ WARNING Background keep alive hit an error: context deadline exceeded

Solution

You problably don't want to mount KBFS as root. Try to run kbfsfuse /keybase as a normal user.

If you're getting similar errors when mounting KBFS as a normal user then try running keybase fs ls /keybase first. This way the required keybased.sock file is created.


"mount_fusefs: /dev/fuse on /keybase: Operation not permitted"

When I run kbfsfuse /keybase I get the following error messages:

▶ INFO KBFS version 1.0.2
▶ WARNING adding NotifyService protocol
▶ INFO | net.Listen on unix:/home/beastie/.config/keybase/kbfsd.sock
▶ INFO OnConnect called with a new connection
▶ INFO authentication successful; ping interval: 30s
▶ INFO authentication successful; ping interval: 30s
▶ INFO MDServerRemote: auth token refreshed
2018/05/11 13:43:55 mount helper error: mount_fusefs: /dev/fuse on /keybase: Operation not permitted
2018/05/11 13:43:55 mount helper error: mount_fusefs: /dev/fuse on /keybase: Operation not permitted
▶ ERROR Mounting the filesystem failed: mount_fusefs: exit status 71

Solution

It looks like you forgot to enable normal users to mount FUSE volumes:

# sysctl vfs.usermount=1


"ERROR Keybase services aren't running - KBFS client not found."

When I run keybase fs ls /keybase I get the following error messages:

▶ ERROR Keybase services aren't running - KBFS client not found.

Solution

You've got to mount your KBFS volume with kbfsfuse.


"ERROR Mount interrupter callback failed: %!(EXTRA *errors.errorString=Forced unmount is not supported on this platform yet)"

Whenever I want to unmount KBFS and I hit Ctrl-C to kill kbfsfuse I get the following messgae

▶ ERROR Mount interrupter callback failed: %!(EXTRA *errors.errorString=Forced unmount is not supported on this platform yet)

Solution

You have got some files open which are stored on the KBFS volume. Close all the programs interacting with KBFS and the issue will be solved.

You may also think of contributing a patch or two to KBFS to add support for FreeBSD. ;)


CategoryHowTo

This wiki page is mentioned in the README of the KBFS repository. Remember to ping Keybase developers if you are willing to rename this page.

Ports/security/keybase (last edited 2020-03-04T22:00:00+0000 by MateuszPiotrowski)