[SOLVED] Using VeraCrypt as normal user

I'm trying to mount an existing encrypted NTFS drive. I managed to install VeraCrypt with rpm-ostree (veracrypt-1.26.24-Fedora-40-x86_64.rpm), and it works as root / bazzite, but as a normal user VeraCrypt fails to acquire the necessary root privileges to mount a drive. I've read it may be related to it using sudo as opposed to handing over the command to bazzite and asking for its password (like Discover does with flatpaks)..? I'm on the latest Bazzite version with KDE. Reading into other posts, others seem be using Distrobox, but since bazzite is Fedora-based I thought that particular file could work.
1 Reply
Female Commando Ivana
I've got a new message from VeraCrypt, which says I'm not in the sudoers file. I had given VeraCrypt the root password last time, which had prompted a different message. Now that I understood sudo better, I gave VeraCrypt my normal username password. Somehow I remember sudo meaning "elevate yourself to admin privileges by giving the root password" instead. Now there are tutorials on the internet about how to add yourself to sudoers or sudoers.d, however as I understand it that would also weaken the security of my system considerably. In some installations of VeraCrypt there seems to be a group veracrypt which you could limit sudo access to, but in my case there is no sudoers.d/veracrypt folder or file. Got help from another Linux user and going to write up the solution for others. 1. Open terminal and change user to root, in case of bazzite: su bazzite 2. Type sudo visudo 3. Scroll to the end of the file and add the line ALL ALL=(ALL) NOPASSWD: /usr/bin/veracrypt 4. Save and exit with Ctrl+S and Ctrl+X. Optionally one can also add the line ALL ALL=(ALL) NOPASSWD: /usr/bin/mount under the other line, but I'm unable to tell whether it made a difference in my case. There's still the issue of VeraCrypt asking for both username and root password, it's not as straightforward as in Windows.

Did you find this page helpful?