Set Up Your Own Password Manager and Sync Simultaneously Between Devices
A password manager is very important in the digital era. So many applications, social media, and other important accounts use passwords even other credential information, remembering one by one account and password is very hard, because of that a password manager is needed like 1Password, Bitwarden, LastPass, and many more, but this is the problem about third-party password manager, all data of your password is managed not just by you, but managed by company you trust too.
Every third-party password manager has a different privacy policy and terms of service depending on where country their company operated. When the password manager company operated in a country with no strict regulations relative to privacy consumers, they can take your data even your account information to their government. A password manager you can manage on your own is important here because all data is yours no third party and no government can access your data.
Now we will set up a password manager that’s will be managed completely by yours, even can be synchronously on every device, and of course, it’s more secure!
First, we will use KeePass as a password manager app to easily and securely save and manage the data on a database with AES-256 encryption (one of the most secure encryption algorithms) and its open source! so many types of KeePass apps developed by the community you can use, but I recommend using KeePassXC on Windows and KeePassDX on android, if you’re using a mac or ios you can select the recommended app on the official KeePass website here.
Next, we will need a server to sync your password anywhere and everywhere, you can use any VPS you trust like Digital Ocean, Amazon AWS, or Vultr, just chose a cheap one, because it’s didn’t need huge performance to sync. Resilio Sync is a peer-to-peer file synchronization tool we used to sync passwords from KeePass Database because Resilio Sync can sync files by the internet even local network between devices which is connected.
Step by Steep
First/Main Device (PC)
- Download KeePass App to your devices from the official website, or you can click below.
KeePassXC - After you download it creates a database and saves the database on a specific folder, later that folder will be used as a sync folder for Resilio Sync.
- Download Resilio Sync from the official website, I prefer to install it as a windows service but you can choose to install it as an app.
- After installed, open Resilio Sync, if you installed it as windows services open a web browser and type http://127.0.0.1:8888/ on the URL bar, if you install it as an app just open it from the app menu.
- Now click the “+” button and select “Standard Folder” to add a sync folder and chose the folder you use to save the KeePass database before. Now your folder is ready to share for sync to another device.
- Back to the main menu of Resilio Sync, right-click on the folder before you add, and select the share button. Select the “key” tab then copy the read & write key. Save the key to use on another device step.
Second Devices (Android)
- Download KeePass App to your devices from the official website, or you can click below.
KeePassDX - Download Resilio Sync from the Play Store.
- Open Resilio Sync and click the “+” button (bottom-right screen) and chose “Enter a key or link”, paste your key copied before there, and then click “Add”. Select the directory of the sync folder on your phone after that. Give a few seconds to Resilio Sync to sync your file.
- Now open KeePass on your phone and add an existing database, open the folder of Resilio Sync that has been synced before on the directory you chose before.
- Type the password and open it. Now your database is ready set and synchronized between PC and mobile. Every time your PC and your phone are online Resilio Sync automatically syncs your password database between devices.
Third (Server)
The last is to set up a server to easily sync all your KeePass database 24/7 over the internet, of course, it’s safe! because Resilio Sync uses AES-128 encryption and KeePass uses AES-256 encryption which needs billions of years to brute force and cracks the encryption.
- First, we need VPS, I use AWS Lightsail with Ubuntu 20.04 LTS here, you can use another VPS but the settings panel little different but the concept is the same.
- Before setting the app open port 8888 UDP and TCP on the VPS, this port is used by Resilio Sync to sync the files between and add/set static IP to the VPS to make access easier.
- Open the VPS terminal and create a folder
sudo mkdir [your-folder-name]
add directory permission access
sudo chmod -R 700 [your-folder-name]
- Next add this Resilio repositories
echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" | sudo tee /etc/apt/sources.list.d/resilio-sync.list
- Add a public key
wget -qO - https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add -
- Now update and install Resilio Sync
sudo apt-get update sudo apt-get install resilio-sync
- Enable auto-start to Resilio Sync
sudo systemctl enable resilio-sync
- Check the status, is Resilio running?
systemctl status resilio-sync
Sample return code of Resilio is running
● resilio-sync.service - Resilio Sync service Loaded: loaded (/lib/systemd/system/resilio-sync.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-10-10 02:22:15 UTC; 6 days ago Docs: https://help.resilio.com Main PID: 43801 (rslsync) Tasks: 17 (limit: 560) Memory: 62.5M CGroup: /system.slice/resilio-sync.service └─43801 /usr/bin/rslsync --config /etc/resilio-sync/config.json Oct 10 02:22:14 ip-172-26-11-240 systemd[1]: resilio-sync.service: Succeeded. Oct 10 02:22:14 ip-172-26-11-240 systemd[1]: Stopped Resilio Sync service. Oct 10 02:22:14 ip-172-26-11-240 systemd[1]: Starting Resilio Sync service... Oct 10 02:22:15 ip-172-26-11-240 systemd[1]: Started Resilio Sync service.
- Next, we will edit the Resilio Sync configuration to the public so that later we can open from the web by IP and set up Resilio Sync to sync the KeePass database.
Open the configuration file of Resilio Syncsudo nano /etc/resilio-sync/config.json
Sample output
{ "storage_path" : "/var/lib/resilio-sync/", "pid_file" : "/var/run/resilio-sync/sync.pid", "webui" : { "force_https": true, "listen" : "127.0.0.1:8888" } }
Change these line
"listen" : "127.0.0.1:8888"
to these
"listen" : "0.0.0.0:8888"
save after that
- Now restart Resilio Sync
sudo systemctl restart resilio-sync
- Access Resilio Sync from https://[your-vps-ip]:8888
- set-up like before, click the “+” button, select “Enter a key or link”, and paste the key of Resilio Sync before, set the folder to the folder you create before on VPS, and done all set!
Now all devices are synchronized 24/7!