You are not logged in.
Hello,
I want to run programs like netctl and vpnc as normal user without typing in my password. This is what I've come up with for /etc/sudoers:
myusername ALL = (root) NOPASSWD: /usr/bin/netctl, /usr/bin/vpnc, /usr/bin/vpnc-disconnect
But running e.g. "netctl start someprofile" fails because access to the file `someprofile' is denied -- the file is owned by root and only root may read it.
Doesn't running programs as root also mean that these programs can read files owned by root? Or is this a misconception and I should change permissions to the corresponding files?
Thanks & Regards
Edit:
I just realized, that, with the setup above, "sudo netctl start someprofile" does work without demanding a password. This is nice. But can it be tuned further so that I don't have to prepend "sudo"?
Last edited by ball (2013-05-23 19:22:17)
Offline
What about;
myusername ALL=(ALL) ALL
myusername ALL=NOPASSWD: /usr/bin/netctl, /usr/bin/vpnc, /usr/bin/vpnc-disconnect
Offline
@qinohe:
I am in group wheel and I already have
%wheel ALL=(ALL) ALL
myusername ALL=NOPASSWD: /usr/bin/netctl, /usr/bin/vpnc, /usr/bin/vpnc-disconnect
So this would be same, wouldn't it?
I just realized, that "sudo netctl start someprofile" does work without demanding a password. This is nice. But can it be tuned further so that I don't have to prepend "sudo"?
Last edited by ball (2013-05-23 18:50:46)
Offline
Yes , you could create an alias, like this;
alias someprofile='sudo netctl start someprofile'
put that, or something like that in your .zshrc or .bashrc.
Now start it the way you want, terminal, button etc.
Of course the alias is for the terminal!
Last edited by qinohe (2013-05-23 19:02:41)
Offline
Ok, I already presumed that. I just wanted to know if the alias is the canonical way to go from here or if it can also be configured in /etc/sudoers. But after all, making use of /etc/sudoers will implicitly mean using "sudo"...
Thanks for clearing this up. Solved.
Offline