You are not logged in.

#1 2009-01-29 12:13:38

petelewis
Package Maintainer (PM)
From: Birmingham, UK
Registered: 2008-08-14
Posts: 128
Website

ArchAssistant: askpass and tty problem

Hi all,

I've just installed ArchAsstistant, as a front-end to netcfg, but it can't switch network profiles, as it doesn't know how to ask me for my password to get root permissions.

The error complains about "no tty" and not having "askpass" set. I have ksshaskpass installed, which I think it needs to use, but I'm not sure how I tell it! Can anyone enlighten me?

Thanks.

Pete.


"Cared thou not, thou would have abstained." - Xyne

Offline

#2 2009-01-31 10:59:28

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: ArchAssistant: askpass and tty problem

Hi


Archassistant need root permission to access networking.

What you need to do is, instead of running archassistant, run "sudo archassistant"


you can change the sudoers file so sudo don't ask you a password for archassistant, which may be helpful


example

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.

#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL
quarkup    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
#%wheel    ALL=(ALL) ALL

# Same thing without a password
%wheel    ALL=(ALL) NOPASSWD: /sbin/ifconfig,/usr/sbin/iwconfig,/sbin/dhcpcd,/usr/bin/archassistant,/usr/bin/ksystemlog
%wheel localhost=/sbin/shutdown -r now

# Samples
%users  ALL=/sbin/mount /media/cdrom,/sbin/umount /media/cdrom
%users  localhost=/sbin/shutdown -h now

(as I belong to 'wheel' and 'users' groups)

good luck

Last edited by quarkup (2009-01-31 11:31:01)


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#3 2009-01-31 14:24:08

petelewis
Package Maintainer (PM)
From: Birmingham, UK
Registered: 2008-08-14
Posts: 128
Website

Re: ArchAssistant: askpass and tty problem

Thanks for the reply quarkup.

quarkup wrote:

Archassistant need root permission to access networking.

What you need to do is, instead of running archassistant, run "sudo archassistant"

Hmmm... really? I have to run it as root? I don't generally like doing things like that :-/

I thought, since it seems to know about askpass, that it might be able to ask me on a per-use basis.

good luck

Thanks :-)


"Cared thou not, thou would have abstained." - Xyne

Offline

#4 2009-01-31 15:11:04

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: ArchAssistant: askpass and tty problem

Never knew otherwise than running ArchAssistant as root, it is pretty safe

Offline

#5 2009-02-02 22:32:21

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: ArchAssistant: askpass and tty problem

petelewis wrote:

Thanks for the reply quarkup.

Sure.

petelewis wrote:

Hmmm... really? I have to run it as root? I don't generally like doing things like that :-/

It is secure, at least for that application.

petelewis wrote:

Thanks :-)

big_smile


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#6 2009-03-04 10:09:13

petelewis
Package Maintainer (PM)
From: Birmingham, UK
Registered: 2008-08-14
Posts: 128
Website

Re: ArchAssistant: askpass and tty problem

I just thought I'd add that I recently discovered netcfggui - it's in the AUR - which is basically just the netcfg part of ArchAssistant, and gives you a nice icon indicating the strength of your signal. In the end, this just meant that I only have to add the following lines to my sudoers file:

username ALL=NOPASSWD: /usr/bin/netcfg
username ALL=NOPASSWD: /usr/bin/netcfg-auto-wireless

where 'username' is my username. Now I don't have a button I can press which might well overwrite my /etc/rc.conf or something similar!

netcfggui also has a nice feature which will run netcfg-auto-wireless if a connection is dropped, which is nice.

Just thought I'd share....


"Cared thou not, thou would have abstained." - Xyne

Offline

#7 2009-03-04 11:12:59

n8schicht
Member
From: Südbaden
Registered: 2006-12-27
Posts: 138
Website

Re: ArchAssistant: askpass and tty problem

quarkup wrote:

Archassistant need root permission to access networking.

What you need to do is, instead of running archassistant, run "sudo archassistant"

The author of the software describes how to set up archassistant properly:

READ NON-ROOT USERS:
--------------------
  Archassistant uses 'netcfg2' as a backend to connect the networks. Unfortunately, netcfg2 cannot be run by non-root users. This is a problem. Another one is that '/etc/network.d' folder, where profiles are stored, cannot be written by non-root users. What can be done :

  1/ edit '/etc/sudoers' file as root and insert entries like these :

     # User alias specification
     User_Alias    NETPROFILERS=lisa, homer, marge, bart

     # Cmnd alias specification
     Cmnd_Alias NETPROFILES=/sbin/ifconfig,/usr/bin/iwconfig,/usr/sbin/iwlist,/usr/bin/netcfg2,/bin/hostname,/usr/sbin/lspci

     # User privilege specification
     NETPROFILERS    ALL=NOPASSWD: NETPROFILES

  2/ change permissions for '/etc/network.d' directory. For instance, you may change the group owner to a group where your users belong (for example, the group 'network'). Example :

     chgrp -R network /etc/network.d/

So you don't have to run the program itself with sudo or root permissions.

Offline

Board footer

Powered by FluxBB