LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   normal user removing a root file? (https://www.linuxquestions.org/questions/linux-newbie-8/normal-user-removing-a-root-file-680552/)

bashyow 11-01-2008 08:53 PM

normal user removing a root file?
 
my normal user needs to remove a non-system critical file owned by root.

is this possible using sudo? I've tried doing 'rm /path/to/file' in the sudoers, but it wont write the file, I get a syntax error.

or is there another way of doing it?

Tinkster 11-01-2008 08:57 PM

Should be possible, what does the relevant line look like?


Cheers,
Tink

bashyow 11-01-2008 09:05 PM

its this:

Code:

rm /etc/dhcpc/dhcpcd-wlan0.pid
*edit* I was able to remove the file, thanks anyway Tinkster.

first I forgot to include the full path of the rm command in the sudoers file:
Code:

%shutdown ALL=(root) NOPASSWD: /bin/rm /etc/dhcpc/dhcpcd-wlan0.pid
second, when executing the command on the CL, I forgot to prefix the command with 'sudo' !

jschiwal 11-01-2008 10:44 PM

Why isn't /var/run/dhcpc/dhcpcd-wlan0.pid used instead. You would still need to configure sudoers because of the sticky bit.

bashyow 11-02-2008 12:32 PM

Quote:

Originally Posted by jschiwal (Post 3328748)
Why isn't /var/run/dhcpc/dhcpcd-wlan0.pid used instead. You would still need to configure sudoers because of the sticky bit.

I dont have a /var/run/dhcpc directory, just an /etc/dhcpc/dhcpcd-wlan0.pid.


All times are GMT -5. The time now is 01:33 AM.