unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Allow my usual user reconnect to wifi without root pass and also replace wpa config
@ 2021-01-01 19:07 znavko--- via
  2021-01-02  0:01 ` znavko
  0 siblings, 1 reply; 2+ messages in thread
From: znavko--- via @ 2021-01-01 19:07 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Hello! Happy New Year, Guix Help!

I'd like to make my OS a bit comfortable for usual user.

I use only wpa_supplicant + dhclient without any utility that gives control over wifi to usual users.
And I want to give such a control by my own hands and your advice.

Wi-fi connection sometimes is loosing, and the way to reconnect is to restart hurd services.
I do it by root beautifully. I need to allow usual user to do this too.

With that task I also have two providers: wired ISP and Mobile ISP -
And I have such a script for choosing between them.
Attachment: wpa

So this script fulfill things of reconnection and changing wpa_supplicant.conf
very easy for root.
I want to allow to usual user just to run:

$ /wpa isp

and my script reconnect to wifi again.

I tried to give root privileges for user 'bob' to run script /wpa with this line in /etc/sudoers:
# cat /etc/sudoers
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
user ALL=(bob) NOPASSWD: /wpa
#groups bob
bob : users wheel video audio netdev
But I still have these error messages:

$ sudo -u bob /wpa isp
Connecting to ISP provider
cp: cannot create regular file '/etc/wpa_supplicant/wpa_supplicant.conf': Permission denied
error: connect: /run/user/1000/shepherd/socket: No such file or directory
error: connect: /run/user/1000/shepherd/socket: No such file or directory
^X^C
$
Please, what to do here?

[-- Attachment #2: wpa --]
[-- Type: application/octet-stream, Size: 807 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Allow my usual user reconnect to wifi without root pass and  also replace wpa config
  2021-01-01 19:07 Allow my usual user reconnect to wifi without root pass and also replace wpa config znavko--- via
@ 2021-01-02  0:01 ` znavko
  0 siblings, 0 replies; 2+ messages in thread
From: znavko @ 2021-01-02  0:01 UTC (permalink / raw)
  To: znavko--- via

I've added these additions to config.scm, thinking it will give effect:

(define %sudoers-specification
  (plain-file "sudoers" "root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
ALL ALL=(ALL) NOPASSWD: /wpa"))
....

(operating-system
...
		  (sudoers-file %sudoers-specification)
)

And reconfigured. And it works!

Note that must run it with sudo!

$ sudo /wpa isp
Connecting to ISP provider
Service networking has been stopped.
Service wpa-supplicant has been stopped.
Service wpa-supplicant has been started.
Service networking has been started.


Very nice.
My usual user works nice with wpa_supplicant now.

Thanks to draketo and his config example
https://www.draketo.de/software/guix-config.html



January 1, 2021 7:08 PM, "znavko--- via" <help-guix@gnu.org> wrote:

> Hello! Happy New Year, Guix Help!
> 
> I'd like to make my OS a bit comfortable for usual user.
> 
> I use only wpa_supplicant + dhclient without any utility that gives control over wifi to usual
> users.
> And I want to give such a control by my own hands and your advice.
> 
> Wi-fi connection sometimes is loosing, and the way to reconnect is to restart hurd services.
> I do it by root beautifully. I need to allow usual user to do this too.
> 
> With that task I also have two providers: wired ISP and Mobile ISP -
> And I have such a script for choosing between them.
> Attachment: wpa
> 
> So this script fulfill things of reconnection and changing wpa_supplicant.conf
> very easy for root.
> I want to allow to usual user just to run:
> 
> $ /wpa isp
> 
> and my script reconnect to wifi again.
> 
> I tried to give root privileges for user 'bob' to run script /wpa with this line in /etc/sudoers:
> # cat /etc/sudoers
> root ALL=(ALL) ALL
> %wheel ALL=(ALL) ALL
> user ALL=(bob) NOPASSWD: /wpa
> #groups bob
> bob : users wheel video audio netdev
> But I still have these error messages:
> 
> $ sudo -u bob /wpa isp
> Connecting to ISP provider
> cp: cannot create regular file '/etc/wpa_supplicant/wpa_supplicant.conf': Permission denied
> error: connect: /run/user/1000/shepherd/socket: No such file or directory
> error: connect: /run/user/1000/shepherd/socket: No such file or directory
> ^X^C
> $
> Please, what to do here?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-02  0:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 19:07 Allow my usual user reconnect to wifi without root pass and also replace wpa config znavko--- via
2021-01-02  0:01 ` znavko

unofficial mirror of help-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git