You could try the solution suggested in this reddit thread, and use systemctl
to start and stop wireguard instead of wg-quick
.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Maybe not too helpful, but could point you in the right direction: you used to be able to use "gksudo" to get the graphical popup requesting your password in lieu of sudo which would only ask for a password in terminal. I believe gksudo is deprecated/non-existent at this point but there's got to be an alternative out there. Best of luck!
Alternatively you can launch sudo inside a terminal window. For example with xterm: xterm -e sudo [some command] [some arguments] [...] This will pop up a terminal window to type your password in.
Pretty sure almost all terminal emulators have a similar argument.
You could configure sudo without password only for the wg-quick command. Not a beautiful solution and also not super easy to configure with sudo but it's an option. Much easier solution is to install doas or opendoas and leave sudo as it is. Let's assume your desktop user is named variants and in group variants, then putting the following in /etc/doas.conf is expected to work :
permit nopass :variants cmd wg-quick
If your user is not yet in a group, and you add a new group, remember that making such a change usually requires logging out and logging in again because the group changes become visible. Then test with doas wg-quick up wg0