Author Topic: {Solved} Replacement for kdesu in minime?  (Read 1652 times)

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
{Solved} Replacement for kdesu in minime?
« on: March 31, 2011, 10:02:53 AM »
I use kdesu in a rather old script for the mythtv package - but suddenly it does not work in updated minime

This is what I try:

kdesu "gpasswd -u mbantz mythtv"

to add username mbantz  to a mythtv group, but it does not work.

One manual page for kdesu states that it only can be used with gui programs.

Is there another gui kdesu alike program that can run a non-gui program such as gpasswd in minime (kde)?
« Last Edit: March 31, 2011, 04:45:53 PM by MBantz »

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Replacement for kdesu in minime?
« Reply #1 on: March 31, 2011, 10:23:39 AM »
Hi MBantz,

To add a user to a group I type in a root console:

Code: [Select]
gpasswd -a user group
gksu and kdesu are needed to start gui applications.

Now, if you need to use something else than kdesu, and not related to a desktop environment, we do have "ktsuss" in our repositories, since about a pair of months, as Texstar accepted to make it available. The sources are not young (Texstar had said he didn't know if it would work due to the age of the program), but I don't use anything else in my system when I want to start a gui app from console. :D

It works perfect !
« Last Edit: March 31, 2011, 10:25:50 AM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Replacement for kdesu in minime?
« Reply #2 on: March 31, 2011, 11:17:39 AM »
As gpasswd is a GTK app, gksu should work.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Replacement for kdesu in minime?
« Reply #3 on: March 31, 2011, 11:31:42 AM »
As gpasswd is a GTK app, gksu should work.

Hi,

I think you are mistaking. gpasswd is a text mode tool.

Code: [Select]
# gpasswd
Usage: gpasswd [option] GROUP

Options:
  -a, --add USER                add USER to GROUP
  -d, --delete USER             remove USER from GROUP
  -r, --remove-password         remove the GROUP's password
  -R, --restrict                restrict access to GROUP to its members
  -M, --members USER,...        set the list of members of GROUP
  -A, --administrators ADMIN,...
                                set the list of administrators for GROUP
Except for the -A and -M options, the options cannot be combined.

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline siamer

  • Sr. Member
  • ****
  • Posts: 284
    • ZEN-mini
Re: Replacement for kdesu in minime?
« Reply #4 on: March 31, 2011, 02:11:25 PM »
you can think about sudo as well... working fine on pclinuxos

Regards,
siamer
Every man dies, but not every man really lives... !!

   

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Replacement for kdesu in minime?
« Reply #5 on: March 31, 2011, 04:45:25 PM »
Thanks all!

I got it sorted out!

Ktsuss is great for the multiple-DE scripts! Though it crashed when I tried the command ktsuss -?

Also, it appear that kdesu can be used, it just need the parameter -c before the command - I guess kdesu has changed this a couple of months ago, it worked before without -c

Using sudo require the username in sudoers I guess - haven't double-checked.

Again, thanks for all the answers,

cheers,
MBantz

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Replacement for kdesu in minime?
« Reply #6 on: March 31, 2011, 05:00:17 PM »
Ktsuss is great for the multiple-DE scripts! Though it crashed when I tried the command ktsuss -?


Hi,
It does not provide this option.

Quote
$ ktsuss --help
Usage: ktsuss [OPTION] command [COMMAND ARGUMENTS]
Run a command as another user

OPTIONS:
   -v, --version        Gives ktsuss version info
   -u, --user USER      Runs the command as the given user
   -m, --message MESG   Change default message in ktsuss window
   -h, --help           Show this help


sudo needs your user to be configured with the visudo command started from a root console. You can add your user, or uncomment the wheel line and add your user to the wheel group.

A given user (here his name is guvnr):


Other methods:
https://wiki.archlinux.org/index.php/Sudo

You still don't need kdesu, gksu, or ktsuss to use gpasswd : they are tools to give temporary admin priviledges to some gui applications, whereas gpasswd is a text only command tool.

« Last Edit: March 31, 2011, 05:02:35 PM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: {Solved} Replacement for kdesu in minime?
« Reply #7 on: March 31, 2011, 05:35:46 PM »
Hi Melodie,

yes, gpasswd is a non-gui program, and I am (well) aware about kdesu and gksu functionality. How do you suggest it can be used without root access? gpasswd need access to /etc/group and this file has readonly permissions for all but root.

If I just use su then the user will never be presented with the password-prompt for su when in a non-terminal mode
« Last Edit: March 31, 2011, 05:42:22 PM by MBantz »

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: {Solved} Replacement for kdesu in minime?
« Reply #8 on: April 01, 2011, 01:48:33 AM »
If I just use su then the user will never be presented with the password-prompt for su when in a non-terminal mode


Hi,
I think I understand : it is about a post install command, for a package you are building ?
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: {Solved} Replacement for kdesu in minime?
« Reply #9 on: April 01, 2011, 08:13:12 AM »
not quite, in the %post section of an rpm all commands will be executed as root.

This script is used when a user on a system would like to setup mythtv. This is not supposed to be done as root but in the group also named mythtv. To make the user member of the mythtv group the gpasswd command is used and this need root access. If I write a bash script and present the user with a terminal then su will be fine for all DE's - but I use zenity to give a GUI frontend to this function,

cheers,
MBantz