Cant see /var/www/html when logging in to FTP

General support questions
Post Reply
PresFox
Posts: 11
Joined: 2018/05/21 08:55:26

Cant see /var/www/html when logging in to FTP

Post by PresFox » 2018/10/16 04:47:00

Hello,

I have a fresh install of Centos 7.5, installed LAMP and all seems to be working fine,

Site is running from /var/www/html/

However, when i login to FTP, i cant see that directory, according to my FTP client /var/ is empty...

I really dont like having to do all my uploading and editing through shell, how can i get access to that folder via FTP? Server is vsftpd.

Thanks in advance!

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Cant see /var/www/html when logging in to FTP

Post by hunter86_bg » 2018/10/16 05:48:07

SELINUX is preventing the access.If you wish to allow access for both FTP and HTTP you need to relabel the location and allow both FTP and HTTP daemons to use it.
So in your case it should be something like (public_content_t -> read-only,public_content_rw_t-> rw):

Code: Select all

yum install policycoreutils-{python,devel}
semanage fcontext -a -t public_content_rw_t "/var/www/html(/.*)?"
restorecon -RFvv /var/www/html 
setsebool -P allow_ftpd_anon_write on
setsebool -P allow_httpd_anon_write on
In order to debug SELINUX issues you can:
1.Install necessary software:

Code: Select all

yum install setroubleshoot-server
2.Run sealert against the logs:

Code: Select all

sealert -a /var/log/audit/audit.log
Edit: fixed the second 'setsebool' command

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: Cant see /var/www/html when logging in to FTP

Post by tunk » 2018/10/16 09:56:02

FTP is insecure.
If you're on a windows client use e.g. filezilla or winscp in ssh mode.

Post Reply