LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2005, 08:22 PM   #1
max2004
Member
 
Registered: Feb 2005
Posts: 57

Rep: Reputation: 15
Give user rights to execute program


Hi,

there is a program that requires root-rights to execute (I don't know why, it can't do anything bad). How can I make it possible for a user to run it?
What I want to do is to have a button on the desktop to run it, therefore it is not an option to always open a console run the su command and then the program.

Thanks! Max
 
Old 11-21-2005, 08:57 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
As root
chmod u+s /path/to/file

How do you know it can't do harm for sure? :}


Cheers,
Tink
 
Old 11-22-2005, 12:11 AM   #3
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
How do you know it can't do harm for sure? :}
Because I read and understood the source code line by line =)

When I do what you told me, I get the message: "The KDE libraries are not designed to run with suid privileges" (it is a KDE program).
 
Old 11-23-2005, 08:21 AM   #4
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally posted by max2004
When I do what you told me, I get the message: "The KDE libraries are not designed to run with suid privileges" (it is a KDE program).
Don't take my word for it but install 'sudo'?? Then, when it's set up, put sudo in front of command you want to execute. E.g. 'sudo ls'.

There's also a thing called 'fake root' or something, might be relevant.
 
Old 11-28-2005, 05:09 PM   #5
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
I added myself withthe program to the sudoers, but the prob with the KDE lib remains. What else can I do?

Thanx, max
 
Old 11-28-2005, 07:45 PM   #6
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
In KDE create a 'Link to Application' on the desktop (or on the panel) and point it to your binary. Now right click->Properties on the link you just created (as .desktop file) and go Application->Advanced Options, in there there is an option to 'run as a different user'.
 
Old 11-30-2005, 05:33 PM   #7
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
Okay, that still asks me for a password, but it's better than nothing - thanks!
 
Old 11-30-2005, 07:17 PM   #8
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
If you want it to be without a password you'll have to use sudo. Put a line like this in /etc/sudoers:
Code:
username  ALL=(ALL) NOPASSWD: /usr/bin/programtorun
then setup the shortcut to execute 'sudo /usr/bin/programtorun'. You can then untick the option to run as a different user. Sudo should work with kde apps - I just tried 'sudo /usr/bin/konqueror' then and it worked.

Last edited by tkedwards; 11-30-2005 at 07:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to give execute permissions needanyhelp? Linux - General 4 08-20-2004 05:19 AM
how to execute my program when any user logs off my linux server ? rags2k Programming 8 08-17-2004 02:33 PM
How can I give rights for using Floppy Drive to other users? dineshjk Linux - Newbie 2 05-07-2004 03:58 AM
Linux PDC - How Do I give the Samba User Local Admin Rights on XP machine? Vince0000 Linux - Networking 4 12-18-2003 02:54 AM
How to give root's rights Qebex Linux - General 2 09-25-2002 11:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration