This is a minimal command-line application that creates vaults of vault format 8, changes their passphrase, and unlocks and mounts a single vault into the system.
Download the zip file via GitHub Releases and unzip it to your desired directory, e.g.
curl -L https://github.com/cryptomator/cli/releases/download/0.7.0/cryptomator-cli-0.7.0-mac-arm64.zip --output cryptomator-cli.zip
unzip cryptomator-cli.zipAfterward, you can directly run Cryptomator-CLI by calling the binary from a terminal, e.g. on Linux:
./cryptomator-cli/cryptomator-cli unlock \
--password:stdin \
--mounter=org.cryptomator.frontend.fuse.mount.LinuxFuseMountProvider \
--mountPoint=/path/to/empty/dir \
/home/user/myVaultNote
On macOS, the path to the binary is cryptomator-cli.app/Contents/MacOS/cryptomator-cli
To unmount, send a SIGINT signal to the process, e.g. by pressing CTRL+C in the terminal.
For a complete list of options, use the --help option.
cryptomator-cli --helpcryptomator-cli create --password:stdin /path/to/newVaultThe vault directory must not exist yet. The passphrase must be at least 8 characters long (same rule as the desktop app). When typed in a terminal, you are asked to confirm it. No recovery key is generated by the CLI; if you want one, open the vault once in the Cryptomator desktop app and use Vault Options → Recovery Key.
cryptomator-cli change-password --password:stdin --new-password:stdin /path/to/vaultThe current passphrase is given with one of --password:stdin, --password:env, --password:file, the new one with one of --new-password:stdin, --new-password:env, --new-password:file. The sources can be mixed, e.g. --password:file=old.txt --new-password:stdin.
Both passphrases can also be piped, one per line:
printf '%s\n%s\n' "$OLD" "$NEW" | cryptomator-cli change-password --password:stdin --new-password:stdin /path/to/vaultWhat happens:
- The current passphrase is verified. If it is wrong, nothing is changed.
- The masterkey file (
masterkey.cryptomator) is re-encrypted with the new passphrase. The masterkey itself and the vault content stay the same, so this is quick even for big vaults and it works the same way as in the desktop app. - Unless
--no-backupis given, the old masterkey file is kept asmasterkey.cryptomator.<hash>.bkup. That backup can still be opened with the old passphrase. If you are changing the passphrase because the old one leaked, delete the backup (and any synced copies) once you have checked that the new passphrase works. - The new file is written atomically and verified by loading it with the new passphrase; if that fails, the old file is restored.
Note
Changing the passphrase does not protect against someone who already had both the old masterkey file and the old passphrase: the masterkey is unchanged. In that case create a new vault and move the files over.
Note
Passphrase files may end with a single LF or CRLF line break and may start with a UTF-8 BOM; both are ignored.
To integrate the unlocked vault into the filesystem, cryptomator-cli relies on third party libraries which must be installed separately. These are:
- WinFsp for Windows
- macFUSE or FUSE-T for macOS
- and libfuse for Linux/BSD systems (normally provided by a fuse3 package of your distro, e.g. ubuntu)
As a fallback, you can skip filesystem integration by using WebDAV.
To list all available mounters, use the list-mounters subcommand:
cryptomator-cli list-mountersPick one from the printed list and use it as input for the --mounter option.
If you don't want a direct integration in the OS, choose org.cryptomator.frontend.webdav.mount.FallbackMounter for --mounter.
It starts a local WebDAV server, where you can access the vault with any WebDAV client or mounting it into your filesystem manually.
Note
The WebDAV protocol is supported by all major OSses. Hence, if other mounters fail or show errors when accessing the vault content, you can always use the legacy WebDAV option. WebDAV is not the default, because it has a low performance and might have OS dependent restrictions (e.g. maximum file size of 4GB on Windows)
Open the File Explorer, right click on "This PC" and click on the menu item "Map network drive...".
- In the Drive list, select a drive letter. (Any available letter will do.)
- In the Folder box, enter the URL logged by the Cryptomator CLI application.
- Select Finish.
First, you need to create a mount point for your vault:
sudo mkdir /media/your/mounted/folderThen you can mount the vault:
echo | sudo mount -t davfs -o username=,user,gid=1000,uid=1000 http://localhost:8080/demoVault/ /media/your/mounted/folder
# Replace gid/uid with your gid/uid. The echo is used to skip over the password query from davfsTo unmount the vault, run:
sudo umount /media/your/mounted/folderMount the vault with:
osascript -e 'mount volume "http://localhost:8080/demoVault/"'If a handle to a resource inside the unlocked vault is still open, a graceful unmount is not possible and cryptomator-cli just terminates without executing possible cleanup tasks. In that case the message "GRACEFUL UNMOUNT FAILED" is printed to the console/stdout.
On a linux OS with the LinuxFuseMountProvider, the manual cleanup task is to unmount and free the mountpoint:
fusermount -u /path/to/former/mountpoint
For other OSs, there is no cleanup necessary.
The integration tests run against the packaged app image, i.e. they test the actual binary and not just the Java code. Hence, you first need to build the app image with the build script for your OS (e.g. build_win.ps1) and afterwards run:
./mvnw verify -DskipITs=falseIf the app image is not located in the default output directory target, you can specify the path to the binary with -Dcli.executable=/path/to/cryptomator-cli.
This project is dual-licensed under the AGPLv3 for FOSS projects as well as a commercial license derived from the LGPL for independent software vendors and resellers. If you want to use this library in applications, that are not licensed under the AGPL, feel free to contact our support team.