problem retaining username

Andrew Solomon andrews at
Sun Sep 8 03:08:06 EDT 2002

I apologise if this question is already answered and I just don't
understand it:

TASK: I want to write a script, called by any user,
which creates a file owned by root in a directory owned by root.

e.g user types


and timestamp does

  touch /root/<loginname>.timestamp

PROBLEM: I'm having two problems.

1) the script is owned by root with permissions 700
but with the following line in my sudoers:

  andrews machname=/bin/ !set_logname

I get the message

  Sorry, user andrews is not allowed to execute '/bin/' 
  as root on

What am I doing wrong?

2) If I *were* able to execute /bin/ 
as root but with $USER unchanged by sudo, I would worry that 
the person executing 
  sudo /bin/

had tampered with their $USER variable. Is there any way of ensuring
this had not been done?

best wishes,

Faculty of IT, UTS           
Broadway, NSW 2007, Australia          phone:+61.2.9514 7938
CRICOS Provider 00099F                 room:UTS blg 10/4.433

More information about the sudo-users mailing list