Re: SELinux Permission for download a file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 6 Oct 2020 20:31:41 +0000 (UTC)
Jason Long <hack3rcon@xxxxxxxxx> wrote:

> Hello,
> I created a file under of my root website and when I want to download
> it then:
> 
> # wget https://URL.com/file.txt
> --2020-10-06 23:53:22--  https://URL.com/file.txt
> Resolving URL.com (URL.com)... 80.253.145.77
> Connecting to URL.com (URL.com)|80.253.145.77|:443... connected.
> HTTP request sent, awaiting response... 403 Forbidden
> 2020-10-06 23:53:22 ERROR 403: Forbidden.
> 
> The SELinux label of file is:
> 
> -rwxr-xr-x.  1 apache apache unconfined_u:object_r:user_home_t:s0
>      95849 Oct  6 23:51 file.txt
> 
> How can I solve it?

Simplest way is probably to label the file with a suitable context type
that the web server can read, e.g. httpd_sys_content_t

chcon -t httpd_sys_content_t /path/to/file.txt

Paul.
_______________________________________________
selinux mailing list -- selinux@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to selinux-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/selinux@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux