0

i am sudo user and i copied files from one user account to another user's account and i gave permissions like

              sudo chmod 777 ..../*.*

but it is giving like

        -rwxrwxrwx 1 root root    7168 2011-04-26 10:44 test.db
        -rwxrwxrwx 1 root root 3826370 2011-04-26 10:44 libport.a

but when other user who has copied files,cant remove those files by giving

        rm test.db
        rm libport.a

so what should i do without installing any softwares?

Thanks in advance

3

2 Answers 2

2

Creating and removing files in a directory requires write access to the directory, not the files themselves.

I should mention that, in the UNIX world, it is 777 which is the number of the beast rather than 666. Setting your permissions to 777 is almost always a bad idea.

In addition, setting the permissions on files currently in existence has zero effect of files which will be created in the future. The permissions given to files are (when unspecified) determined by your umask setting.

1
  • I agree 777 is bad - data files should not be executable! But the number of the beast is also bad; public write permission should normally be avoided (so 666 is not good; 664 or 644 is much better). Apr 26, 2011 at 6:21
0

To change ownership of files use:

sudo chown system_username / file_location

To change file permissions use:

sudo chmod 0777 (or the permissions you want) / file_location

Use the second command and apply it to the directory in which your copied files are placed. That will give file create & delete access inside that directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .