PDA

View Full Version : replace a file in user level



munna_dude
09-01-2007, 10:33 AM
hi all
how to replace a file in user level..
i tried this


cp -r /usr/lib/munna.txt /usr/lib/

saying the error permission denied..
is there any way..

please help me to replace a file in user level (not from root)

thank you in advance

matsp
09-01-2007, 10:40 AM
There is a reason you can't do that! That's the whole point of file-permissions. You need to be root to write files into /usr/lib.

--
Mats

munna_dude
09-01-2007, 10:47 AM
There is a reason you can't do that! That's the whole point of file-permissions. You need to be root to write files into /usr/lib.

--
Mats


for my application(exe)
i instaaled the rpm in root level.
then i ran the exe from user level..
while running the exe this replace could be take place..

please show me the way..

thank you in advance

matsp
09-01-2007, 10:57 AM
If you are NOT root, then you can't write to /usr/lib, that's it! This is called "file protection", and most OS's have it. It's there so that normal user's can't mess the system up.

--
Mats

ZuK
09-01-2007, 11:03 AM
then i ran the exe from user level..
while running the exe this replace could be take place..

So that executable propably has the suid bit set and runs with the rights of root.
Kurt

ssharish2005
09-01-2007, 02:16 PM
try


sudo cp -r /usr/lib/munna.txt /usr/lib/


You should be know the root password to execute this command. Which distribution are u using?

ssharish2005