How to set file and folder permissions for FTP users in CentOS & Redhat Linux#

To check the current permissions use the following command when you are at the relevant top folder:

ls -l

This will output something similar to this:

drwxrwxr-x 13 ftpuser apache 4096 Dec  9 16:09 folder1
drwxrwxr-x 10 ftpuser apache 4096 Jan  5 16:55 folder2
drwxrwxr-x  5 ftpuser apache 4096 Oct  5 13:14 folder3
drwxr-xr-x  2 root    root   4096 Jan  4 10:35 folder4

To set /folder4 the same as the other folders, so that 'ftpuser' owners the folder and allow any member of apache group to access files inside, run the following command: (when logged on as root).

chown ftpuser:apache /var/www/html/folder4

now that same command: ls - l reveals the following:

drwxrwxr-x 13 ftpuser apache 4096 Dec  9 16:09 folder1
drwxrwxr-x 10 ftpuser apache 4096 Jan  5 16:55 folder2
drwxrwxr-x  5 ftpuser apache 4096 Oct  5 13:14 folder3
drwxr-xr-x  2 ftpuser apache 4096 Jan  4 10:35 folder4

Finally to change the permissions to allow write access:

chmod -R 755 folder4
Or
chmod -R 775 folder4

Depending if you need the Apache group to write to the folder or not. (755 is more restrictive but adequate for most applications)

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-9) was last changed on 24-May-2017 15:30 by Hyve Support
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X
    

All Pages

Page views: 9170

Private Tomcat

Linux

MySQL

Email

SQL Server

ASP

JSP

C#

Web Mail

Windows Plesk

Linux Plesk

PHP

Gaming

ASP.NET

Persits ASPUpload

Wiki Help

Referring Pages:
...nobody

JSPWiki v2.8.1