Keybase是一个基于PGP技术的社交网络平台,它可以将用户的身份映射到公钥,反之亦然。本文介绍 Keybase 命令行使用
介绍
安装
常用命令
# keybase help
NAME:
keybase - Keybase command line client.
USAGE:
keybase [global options] command [command options] [arguments...]
VERSION:
5.2.1-20200225210944+9845113a89
COMMANDS:
account Modify your account
blocks Manage user and team blocks
bot Manage bot accounts
chat Chat securely with keybase users
ctl Control the background keybase service
currency Manage cryptocurrency addresses
decrypt Decrypt messages or files for keybase users
deprovision Revoke the current device, log out, and delete local state.
device Manage your devices
encrypt Encrypt messages or files for keybase users and teams
follow, track Verify a user's authenticity and optionally follow them
fs Perform filesystem operations
git Manage git repos
id Identify a user and check their signature chain
list-followers List those who follow you
list-following List who you or the given user is publicly following
log Manage keybase logs
login Establish a session with the keybase server
logout Logout and remove session information
oneshot Establish a oneshot device, as in logging into keybase from a disposable docker
paperkey Generate paper keys for recovering your account
passphrase Change or recover your keybase passphrase
pgp Manage keybase PGP keys
ping Ping the keybase API server
prove Generate a new proof
rekey Rekey status and actions
selfprovision Provision a new device if the current device is a clone.
sign Sign a document
signup Signup for a new account
sigs Manage signatures
status Show information about current user
team Manage teams
unfollow, untrack Unfollow a user
update The updater
verify Verify message or file signatures for keybase users
version Print out version and build information
wallet Send and receive Stellar XLM
whoami Output the name of the current user; will exit with a non-zero status if none
service start the Keybase service to power all other CLI options
help, h Shows a list of commands or help for one command
ADDITIONAL HELP TOPICS:
advanced Description of advanced global options
gpg Description of how keybase interacts with GPG
keyring Description of how keybase stores secret keys locally
tor Description of how keybase works with Tor
keybase 生成 PGP Key
生成
➜ ~ keybase pgp gen --multi
Enter your real name, which will be publicly visible in your new key: xiexianbin
Enter a public email address for your key: me@xiexianbin.cn
Enter another email address (or <enter> when done):
Push an encrypted copy of your new secret key to the Keybase.io server? [Y/n] Y
When exporting to the GnuPG keychain, encrypt private keys with a passphrase? [Y/n] Y
▶ INFO PGP User ID: xiexianbin <me@xiexianbin.cn> [primary]
▶ INFO Generating primary key (4096 bits)
▶ INFO Generating encryption subkey (4096 bits)
▶ INFO Generated new PGP key:
▶ INFO user: xiexianbin <me@xiexianbin.cn>
▶ INFO 4096-bit RSA key, ID 901487EA218AEB1A, created 2019-05-25
▶ INFO Exported new key to the local GPG keychain
➜ ~ gpg --list-keys
/Users/xiexianbin/.gnupg/pubring.kbx
------------------------------------
pub rsa4096 2019-05-25 [SC] [有效至:2035-05-21]
11518AF49EAA27D86EA01B5C901487EA218AEB1A
uid [ 未知 ] xiexianbin <me@xiexianbin.cn>
sub rsa4096 2019-05-25 [E] [有效至:2035-05-21]
➜ ~ gpg --list-secret-keys
/Users/xiexianbin/.gnupg/pubring.kbx
------------------------------------
sec rsa4096 2019-05-25 [SC] [有效至:2035-05-21]
11518AF49EAA27D86EA01B5C901487EA218AEB1A
uid [ 未知 ] xiexianbin <me@xiexianbin.cn>
ssb rsa4096 2019-05-25 [E] [有效至:2035-05-21]
➜ ~
获取 PGP Public key
curl https://keybase.io/xiexianbin/pgp_keys.asc | gpg --import
或
keybase pgp export -q 11518af49eaa27d86ea01b5c901487ea218aeb1a | gpg --import
导出公钥,并配置 git GPG key:
gpg --armor --export <pub GPG key ID>
获取 PGP Private key
keybase pgp export -q 11518af49eaa27d86ea01b5c901487ea218aeb1a --secret | gpg --allow-secret-key-import --import
FAQ
Linux Root run keybase
错误日志:
$ run_keybase
mkdir: cannot create directory ‘/run/user/0’: Permission denied
解决办法:
export KEYBASE_ALLOW_ROOT=1 run_keybase
导出 keybase security 错误
keybase pgp export -q <my-keybase-key-id> -s
▶ ERROR No matching keys found
keybase 服务没有保存私钥。