Sudo Problem (File permissions)

Angela Stempfel angela.stempfel at 2wire.ch
Sat May 17 10:03:15 EDT 2003


Hi all

i wrote a java program which executes the nmap command:

sudo nmap -sP -n 192.168.1.0/24 -oG 
/home/hippie/projektarbeit/java/activeHosts.txt

In order to do that u use sudo, so a user has the right to execute nmap. 
I wrote the coresponding entry in
/etc/sudoers
The output of nmap is written in an xml file. And here is the problem. 
On my project PC the file will be
created and belongs to the user who startet the java program ( here is 
is the user stema):

-rwxr--r--    1 stema    stema         212 May 15 10:34 activeHosts.txt
sudo-file:
# User privilege specification
root    ALL=(ALL) ALL
stema ALL=NOPASSWD: /usr/bin/nmap

On my laptop the file will be created as well, but it belongs to the 
root.(i started the program as user hippie):

-rw-r--r--    1 root     root          342 May 16 15:53 activeHosts.txt
sudo-file:
# User privilege specification
root    ALL=(ALL) ALL
hippie  ALL=NOPASSWD: /usr/bin/nmap


The problem is that i can't work (read, write in java) to a file who 
belongs to the root.
I can't understand where the diffrence is. Is this now a sudo Problem? 
Could anybody help
me?

Thanks
Angela




More information about the sudo-users mailing list