• Post Reply Bookmark Topic Watch Topic
  • New Topic

editng file with only root permission  RSS feed

 
S Goyal
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I have some files in the /tmp directory that have only the roots permission to write :
-rw-r--r-- 1 root root 0 Aug 26 17:30 -SMTP-SERVICE-DOWN

I need to write/touch them as a different user. Can I do it programatically through a JSP?
thx
shilpi
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to write/touch them as a different user. Can I do it programatically through a JSP?
The short answer is no.
If whoever set up your JSP/servlet engine was crazy enought to have run it as the root user, you would be able to change or remove any file on the system from a JSP, but I really doubt that this is the case.
The whole point of file ownerships and permissions is to prevent unauthorized users from making changes to important resources.
If you have a genuine need to change this file, you will need to ask your system administrator to log on as "root" and make the file (and maybe the directory it lives in) writable by a user or group that you do have access to.
If you don't have a genuine need to change this file, you are out of luck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!