Skip to content

u/sultanmvp

In this archive from Dec 2017 to Aug 2026

0
posts
20
comments
0
media
33
score

Top comments

It would be fairly easy to script into a GUI prompt, but the command is essentially:

sudo cryptsetup luksOpen /dev/[ENCRYPTED_DEVICE] [NAME]

That will immediately prompt for your LUKS password and unlock the encrypted device to /dev/mapper/[NAME]. [NAME] can be whatever you'd like. You'll then need to mount the unlocked filesystem using something like sudo mount /dev/mapper/[NAME] /mnt.

My assumption is that you would be able to script something where you grab the password from some UI tool (rofi/dmenu/etc), then echo "$PASS_FROM_GUI" | sudo cryptsetup luksOpen /dev/[ENCRYPTED_DEVICE] [NAME]. (Note echoing passwords is probably not the most secure, but 🤷‍♂️ if it's your personal laptop/desktop.

Also, if you want to unmount and lock properly, just work in reverse:

sudo umount /mnt
sudo cryptSetup luksClose [NAME]

Hope this helps!

Edit: Not sure of your DE/WM, but I'm pretty positive that there are friendly Gnome GUIs that will unlock and mount automatically. (Probably tied to GVFS.)

Edit 2: Obviously, place your UI script in your DE's session startup or .xinitrc.

3 points

Not the proper answer, but if you want an easy bulletproof, leak-free setup:

  • install the AUR package stubby
  • edit /etc/stubby/stubby.yml to use proper resolvers (I chose cloudflare); I set my listener to 127.0.0.153:53, but you can use whatever loopback ip/port you want (eg 127.0.0.1:53)
  • sudo systemctl disable systemd-resolved; sudo systemctl stop systemd-resolved
  • sudo systemctl enable stubby; sudo systemctl start stubby
  • echo "nameserver 127.0.0.153" | sudo tee /etc/resolv.conf
  • to prevent random resolvconf/openresolv/dnsmasq/systemd-resolved/NetworkManager/etc from molesting my /etc/resolve.conf, I lock it using sudo chattr +i /etc/resolv.conf

This setup always encrypts all DNS traffic via DNS-over-TLS whether in a trusted or VPN environment. Personally, my benchmarks show that when I use cloudflare's resolvers, it's incredibly fast. (Your experience might differ depending on your location and networks.) And unless you have a horrible internet connection, the use of a local caching resolver is horseshit and just gets in the way (let the remote caching resolver do the dirty work).

And if you ever need to change your DNS temporarily (for captive portals and whatnot), you can temporarily unlock your resolv.conf file with chattr -i. I even have a bash script that simply toggles 8.8.8.8 and 127.0.0.153 to get around Starbucks' captive portal.

3 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.