app which ask authentication at startup

Hi everybody

I’m new to Linux (OpenSUSE), and I have to create a software for it. This is a graphical software.
My soft must change the local ip of the computer. I think I will use the following script :

/sbin/ifconfig eth0 netmask

(for example), in the background of my app. But I think that I need to be a super user (or my app must be launched under sudo).
Am I right ?
If ‘yes’, what is the way to be sure that my app ask the superuser password at startup (like when I launch YaST) ?

Sorry if this is not the good forum to ask this kind of question.


Take a look at the Pluggable Authentication Modules(PAM) for Linux. Do a ‘man pam’ which explains how this works with the config files(/etc/pam.d/ or /etc/pam.conf).

Depends. In yast, you can configure your network devices to allow non-root users to control them. This is enabled for default installs because of knetworkmanager. If someone went through the trouble to change the network settings, then you would run into this problem and would need to run via sudo for the script to run under non-root users.


there are several was to do this, but I guess you are looking so kdesu (gnomesu on gnome) which uses yast for it’s root authentication. It’s very easy to use this just create a link to the program (right click and choose link to program) and in the tab where you choose the executable there is something like advanced configuration there you can select a different user for execution.

Maybe you also want to have a look a sudo.

Hope this helps