Repository navigation
First Run Setup
A fresh installation has no users. The first-run setup creates the first one, the administrator (root), and activates the second authentication factor (2FA) for that account. This page explains why the setup is protected by a token, walks through the two steps and lists the errors you may see.
The setup is reachable without logging in while the installation has no configured user. Without protection, whoever opened a newly installed KeyAnyWhere first would become its administrator, and could read the 2FA secret of that account. That is why it opens only with the CONFIG_INICIAL_TOKEN you generated in Environment Variables, passed once in the address.
The site must answer over HTTPS, as in Web Server and HTTPS, and you need an authenticator app on your phone (any TOTP app, such as Aegis, Google Authenticator or 1Password).
This command prints the address with your token. Open it in your browser.
echo "https://$(sudo grep -oP '(?<=ServerName ).*' /etc/apache2/sites-available/keyanywhere.conf)/users/config-inicial?token=$(sudo grep -oP "(?<=^CONFIG_INICIAL_TOKEN=').*(?='$)" /etc/keyanywhere/keyanywhere.env)"The token only needs to be in the address once: after it is checked, it is kept in the browser session and opens both steps.
The first screen says it will create the first user of the system, who is also the administrator. Fill in the name, the e-mail (used to log in) and a strong password, then save.
2FA is mandatory for every account. The second screen shows a QR code.
- Scan the QR code with your authenticator app. If you can't scan it, the section below it shows the key, the key type (time-based) and the name to type in the app instead.
- Only after the app shows a 6-digit code for KeyAnyWhere, click Completar configuração (Complete setup). The QR code and the key are not shown again.
Open https://<your domain>/ and log in with the e-mail, the password and the current code from the app. You land on the home page, Minha Segurança (My Security).
After the setup, the token no longer opens anything. You can delete it from the environment file:
sudo sed -i '/^CONFIG_INICIAL_TOKEN=/d' /etc/keyanywhere/keyanywhere.envsudo systemctl restart apache2| Message | Cause | What to do |
|---|---|---|
| "A configuração inicial não foi autorizada" (The first-run setup was not authorized), HTTP 403 | No token in the address, a wrong token, or a token shorter than 32 characters. | Print the address again with the command in step 1. |
| You are sent to the login page | The installation is already configured. | Log in. To create more users, see Administration. |
That's the end of the production path. Next:
- Learn the screens: User Guide and Administration.
- Schedule backups now: Backup and Restore.
- Know how to upgrade: Upgrading.
Source code · Issues · Releases · Packagist · Online demo · Hosted edition
1. Getting started
2. Installing in production
- Overview
- Preparing the Server
- Installing KeyAnyWhere
- File Permissions
- Generating Security Keys
- Environment Variables
- Configuration Files
- Database Setup
- Insecure Password Catalog
- Web Server and HTTPS
- First-Run Setup
3. Operating your installation
4. Using KeyAnyWhere
5. Security
6. Development
7. Extending