You are not logged in.

#1 2007-07-13 21:09:17

pudgewacl
Member
Registered: 2007-06-08
Posts: 16

How to run suspend command without entering root password?

Can someone please help get the following command to run without being root:
echo -n "mem" > /sys/power/state

When I try to run the command as a regualr user in the terminal, I get a permision error.  I can run the command in terminal after I type su and enter my password......and the suspend works perfectly....I have no issues with NVIDIA or ipw3945 after rusume.

I was wanting to make a launcher on the XFCE panel or an icon on the desktop that would use this command to suspend my laptop. 

Is it possible to run this command without entering the root password?  If so, how?

I am running Duke with SLiM and XFCE.

Thanks,
Matt

Offline

#2 2007-07-13 21:20:14

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to run suspend command without entering root password?

use sudo
set in  /etc/sudoers to your user NOPASSWD


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2007-07-13 21:42:16

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: How to run suspend command without entering root password?

am i the only one who thinks that is a bad idea? if anyone gets their hands on your laptop, they could just do sudo rm -fr / and seriously mess up your system.  please correct me if i am wrong.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#4 2007-07-13 21:59:20

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: How to run suspend command without entering root password?

rson451 wrote:

am i the only one who thinks that is a bad idea? if anyone gets their hands on your laptop, they could just do sudo rm -fr / and seriously mess up your system.  please correct me if i am wrong.

You can set NOPASSWD on the suspend command only, that is what makes sudo so good.

EDIT: and no, you can't run malicious code by renaming rm to suspend, that would require root access and if you got that you don't need sudo...

Last edited by Ramses de Norre (2007-07-13 22:00:01)

Offline

#5 2007-07-13 22:01:41

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: How to run suspend command without entering root password?

nice, i didnt realize you could limit commands. i will surely be looking into this!  thank you sir.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#6 2007-07-14 23:38:07

Snarkout
Member
Registered: 2005-11-13
Posts: 542

Re: How to run suspend command without entering root password?

If someone got their hands on your laptop and wanted to screw you over, don't you figure dropping it from 5' would be enough?


Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

Offline

#7 2007-07-15 08:53:07

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: How to run suspend command without entering root password?

Snarkout wrote:

If someone got their hands on your laptop and wanted to screw you over, don't you figure dropping it from 5' would be enough?

I prefer a sledgehammer.

Regardless, once someone gets physical access to a machine, you're generally screwed.

Offline

Board footer

Powered by FluxBB