PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 11:51:42 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: {Solved} Replacement for kdesu in minime?  (Read 1010 times)
MBantz
Hero Member
*****
Offline Offline

Posts: 1244



« on: March 31, 2011, 11: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)?
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #1 on: March 31, 2011, 11:23:39 AM »

Hi MBantz,

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

Code:
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. Cheesy

It works perfect !
Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15203


LXDE! Coffee, Bacon and Cheesecake!


« Reply #2 on: March 31, 2011, 12:17:39 PM »

As gpasswd is a GTK app, gksu should work.
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #3 on: March 31, 2011, 12:31:42 PM »

As gpasswd is a GTK app, gksu should work.

Hi,

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

Code:
# 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.

Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
siamer
Sr. Member
****
Offline Offline

Posts: 285



WWW
« Reply #4 on: March 31, 2011, 03:11:25 PM »

you can think about sudo as well... working fine on pclinuxos

Regards,
siamer
Logged

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

   
MBantz
Hero Member
*****
Offline Offline

Posts: 1244



« Reply #5 on: March 31, 2011, 05: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
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #6 on: March 31, 2011, 06: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.

Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
MBantz
Hero Member
*****
Offline Offline

Posts: 1244



« Reply #7 on: March 31, 2011, 06: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
Logged

melodie
Hero Member
*****
Offline Offline

Posts: 6005


XMMP=Jabber, free instant messaging protocol !


WWW
« Reply #8 on: April 01, 2011, 02: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 ?
Logged

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode
MBantz
Hero Member
*****
Offline Offline

Posts: 1244



« Reply #9 on: April 01, 2011, 09: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
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM