Does permission 777 allow scripts outside your server to write on it?

2

Let's say example1.com is located in US, and example2.com is located in EU.

example1.com/folder/ has 777 permission.

Will a script in example2.com be able to write on example1.com/folder/?

Or is the 777 permission only applicable to other users in example1.com server and users in the "outside" world has no access to it?

Edit:

To those asking more details:

US server has folder/ with 777 permission. Now a malicious user happen to know this for whatever reason.

He has control of EU server but absolutely no control over US server, only that he knows folder/ is 777.

Can he put files in US server folder/?

IMB

Posted 2012-10-17T13:39:46.500

Reputation: 4 845

There's really no way to answer this question. If some way is provided that allows the script to do that, then it can do it. If not, not. But there's no way we could know without a very specific case in mind. – David Schwartz – 2012-10-17T13:49:41.527

If a folder has 777 permision then it means any user can write to it. This means any script that has the ability to write to the server can. – Ramhound – 2012-10-17T14:17:34.097

What are the permissions and ownerships on all directories in the directory structure leading up to the respective folder directories, and what user account is the script in example2.com running as? If you provide this information, it would be much easier to formulate a proper answer. – a CVn – 2012-10-17T14:34:06.283

Answers

2

Nicer to read is: chmod a+rwx folder (equivalent to chmod 777 folder)

Means that every user account can:

  • Read the directory content, e.g. ls folder
  • Write a new directory entry, e.g. touch folder/file
  • access (aka aXess) the directory, e.g. cd folder

So normally every account on exaple1.com may write to the folder. If user@example2.eu has access to example1.com via nfs,cifs,ssh he us using an account or service on example1.com that is allowed to access the folder and create a file here.

Caveat: the unknown service you are using may have his own restriction, e.g. export the filesystem only readonly.

For a concrete YES or NO you have to tell a little bit more ;-)

user86064

Posted 2012-10-17T13:39:46.500

Reputation:

1The x is for execute, not access. – a CVn – 2012-10-17T14:32:47.220

On a file you the permission bits have a different meaning. Here was the question about the permissions concerning a directory. – None – 2012-10-17T17:14:55.057

True, but the x still means execute. What differs between a directory and a regular file is what exactly execute permission allows you to do. When you consider files and directories to be two aspects of the same thing, then the "oddities" of read/write/execute permissions on directories make a lot more sense. – a CVn – 2012-10-18T08:10:09.903

1

The question gives only irrelevant information and no relevant information on which an answer could be based.

It's kind of like asking "Can a Greek person fire the manager of a Burger King?" Well, yes if he's got some way to do it. No if he doesn't. But the fact that he's Greek tell us nothing about who he may or may not be able to fire.

Similarly, permissions tell us what local credentials can perform file operations through the normal file interface. They tell us nothing about what might happen indirectly or through other access mechanisms.

David Schwartz

Posted 2012-10-17T13:39:46.500

Reputation: 58 310

0

depending on what the script does, it may or may not have permission to write to the EU server could write to the US server but this is generally unrelated to the permissions of the files and folders on the US server.

we need more depth on what the script does to really answer your question but I'm going to make the assumption that you don't fully understand how file permissions work and how unix/linux systems work and that the answer to your question is absolutely not.

Dario Russo

Posted 2012-10-17T13:39:46.500

Reputation: 116