Merge pull request 'docs(en): Bitwarden admin token guide' (#27) from bitwarden-admin into master

Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org/pulls/27
This commit is contained in:
Inex Code 2023-05-03 10:56:36 +03:00
commit 777f0ed110
1 changed files with 42 additions and 1 deletions

View File

@ -7,4 +7,45 @@ description: >
{{% pageinfo %}}
This article is a stub. More information will be added soon.
{{% /pageinfo %}}
{{% /pageinfo %}}
## Setting an admin token manually
First, make sure your system config is up to date. You may click "upgrade server" in the app and wait for a couple of minutes, or run the following command in the terminal:
```bash
cd /etc/nixos
git pull
```
Then, we have to generate an admin token. Run the following:
```bash
nix-shell -p openssl --run 'openssl rand -base64 48'
```
It will output a string like this:
```
47pFSgYBbS0G0vCG63nX1yyblzgNaqZ40bNuJnwq2hvOy8ABfe+iHRfBeXlfrRdJ
```
This will be a password to your admin account. Copy it and paste it somewhere safe. To set it, we will run the following, replacing `PASSWORD` with the password you just generated:
```bash
jq '.bitwarden.adminToken = "PASSWORD"' /etc/nixos/userdata/userdata.json > /etc/nixos/userdata/userdata.json.new && mv /etc/nixos/userdata/userdata.json.new /etc/nixos/userdata/userdata.json
```
Now, we have to apply the changes:
```bash
nixos-rebuild switch
```
And after rebuilding the system, restart Bitwarden:
```bash
systemctl restart vaultwarden
```
Now, your admin interface is available on `https://password.YOUR.DOMAIN/admin`.