Jump to content

Create shortcut with root access


kde
 Share

Recommended Posts

Dear All..

 

I have been installed xampp in mandriva 2008.0

It is take to much step when we want start or stop this software.

we must open terminal, type su, password and opt/lamm/lampp start

 

Is it possible to create a shortcut in the desktop to start and stopp xampp?

Link to comment
Share on other sites

give your user access to sudo by adding them to the wheel group. then use:

sudo /opt/lamm/lampp start

You will still need a password. There is no way around having to enter a password to start the service, root must start it or else it won't run with the proper privileges (IIRC). You could also look into making a shortcut that uses a graphical version of sudo (I can't remember there names - gnomesudo and kdesudo? or gsudo and ksudo...I'm not sure.)

Edited by tyme
Link to comment
Share on other sites

Thanks all for your reply..

 

I am sorry i am very new in linux. please tell me what is sudo n how to configure it?

@tyme

"give your user access to sudo by adding them to the wheel group"

Thank tyme, how to do that?

 

@daniewicks

"kdesu is what you need if you are a kde user"

where I can download that?

 

@scarecrow

"he can still use visudo to grant permissions to certain services being started without the need of a root password"

It sounds that it can solve the problem.

what should i do to do your suggestion?

 

Thanks all...

Link to comment
Share on other sites

OK, here's how to do it:

- Open a ROOT console, and type in "visudo"

Now at the opened /etc/sudoers configuration file, add a line:

%users  localhost=/opt/lamm/lampp

(of course if the lampp executable is not in the above path, change it accordingly).

Notice though that "visudo" (which is the only way to edit /etc/sudoers) uses vi as a texteditor, so you must have at least a very vague idea about how vi is working!

Now, you can create simplistic scripts like:

#! /bin/bash
/opt/lamm/lampp start

and

#! /bin/bash
/opt/lamm/lampp stop

name the first one "lampstart", the second one "lampstop" and save them at a system PATH - say /bin

Now, change their attributes so that they are executable.

From now on, you can simply press alt+F2 and "lampstart" or "lampstop", or create a desktop shortcut to any of the two. No need to type a password again.

 

Another way is adding yourself at the "wheel" group, as suggested above, and then giving special priviledges to that group (again by using visudo). However, it's not necessary in your case, and more than that giving too many priviledges to the wheel group is a big security risk- you'd better avoid it.

Edited by scarecrow
Link to comment
Share on other sites

@scarecrow

Thanks alot for your complete guide

but i have problem in the firstly step. so i can't go to the next step

when i type visudo, the output code is like this

 

[admin@localhost ~]$ visudo

bash: visudo: command not found

 

or when as su

 

[root@localhost admin]# visudo

bash: visudo: command not found

 

what should I do?

Edited by kde
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...