You are not logged in.
Hi, I want to use $mod+t keybind to restart tor service
I tried this in my config:
bindsym $mod+t exec systemctl restart tor.servicebut it doesn't work (because it needs root permission)
I also tried to use sudo but it doesn't work too(because it wants me to enter my password and that's not possible when I'm use a keybind)
Last edited by AliReza (2019-12-16 15:54:59)
Offline
you can try this, it should prompt for a password rather than fail to work.
pkexec systemctl restart tor.serviceOffline
That doesn't work, pkexec asks for password in command line but I want to use it without command line (by pressing $mod+t)
I tried:
bindsym $mod+t exec pkexec systemctl restart tor.serviceLast edited by AliReza (2019-12-16 10:13:40)
Offline
You could make your terminal emulator ask for password e.g.
termite -e "systemctl restart tor.service" Otherwise you could disable password prompts completely, see visudo
Last edited by Skunky (2019-12-16 10:28:40)
Offline
Add the relevant line to sudoers...
https://wiki.archlinux.org/index.php/Sudo
Offline
You could make your terminal emulator ask for password e.g.
termite -e "systemctl restart tor.service"Otherwise you could disable password prompts completely, see visudo
That worked!
Thanks
Offline
Add the relevant line to sudoers...
https://wiki.archlinux.org/index.php/Sudo
Thanks for your advise, but it I can't do this because of security reasons
Offline
You could also install an actual polkit agent so that pkexec actually gives you a dialog: https://wiki.archlinux.org/index.php/Po … ion_agents
Online
Thanks for your advise, but it I can't do this because of security reasons
What do you mean? You want to be able to run this command without a password, don't you? If not, what is your end goal?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
AliReza wrote:Thanks for your advise, but it I can't do this because of security reasons
What do you mean? You want to be able to run this command without a password, don't you? If not, what is your end goal?
Yes, but I don't want to turn off password asking for sudo command!
Last edited by AliReza (2019-12-17 11:00:25)
Offline
You could also install an actual polkit agent so that pkexec actually gives you a dialog: https://wiki.archlinux.org/index.php/Po … ion_agents
Thanks, I would try it
Last edited by AliReza (2019-12-17 11:04:47)
Offline
Trilby wrote:AliReza wrote:Thanks for your advise, but it I can't do this because of security reasons
What do you mean? You want to be able to run this command without a password, don't you? If not, what is your end goal?
Yes, but I don't want to turn off password asking for sudo command!
I wasn't suggesting that you allow any usage of sudo without a password - just that one specific command.
Offline
AliReza wrote:Trilby wrote:What do you mean? You want to be able to run this command without a password, don't you? If not, what is your end goal?
Yes, but I don't want to turn off password asking for sudo command!
I wasn't suggesting that you allow any usage of sudo without a password - just that one specific command.
How can I do that?
Offline
Offline