Jump to content

Auto File Permissions When Uploading Via Ftp


mlex

Recommended Posts

When I upload files/folders to my user dir, I'm getting odd permissions(775, 664) and sometimes even none(for some folders) and I must change them manually... As far as I can say, this should be done on the server side config somehow. Could anyone assist me with this, please?

Link to comment
Share on other sites

It only does this with SSH settings:

 

 

SFTP - SSH File Transfer Protocol

 

If you'll upload with these settings instead, the file permissions will be correct:

 

 

FTP - File Transfer Protocol
Use explicit FTP over TLS if available
Link to comment
Share on other sites

I highly recommend using SFTP for the encryption because the world in general seems to be moving towards the idea that any company or ISP or government is entitled to snoop on all of our data traffic, but that's just my personal politics I suppose. Just be aware that if you do use unencrypted FTP it's fairly trivial to intercept your data to sell it or use it against you.

 

Regarding the file permissions, I implemented a permission mask that would force the files to be uploaded with more sensible permissions but it ended up breaking a lot of other things so I put it back the way it was. Most FTP clients you can just right click and change the permissions. I just tested it with filezilla (a very commonly used ftp client) and you can even right click a directory and set the permissions to 644 for all files recursively in the directory. So you could just do that on your public_html each time you upload something. It's only a few extra mouse clicks.

Link to comment
Share on other sites

Yes, exactly... This will be less secure using the

Use explicit FTP over TLS if available

 

I'm actually using the FileZilla client, but doing this for each file is... frustrating :)

 

CHMODing public_html... well, isn't that not the right way to go? I mean obviously there could(and will) be files I don't want to CHMOD as usual ones, .htaccess for example, or just random other files I don't want to CHMOD as usual ones for security reasons, but yet, locate them within the public_html folder.



UPDATE: Hm... Seems like CHMODing files with 644 is actually enough secured even for sensitive files. Am I getting this right?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...