Yesterday I have changed my usergroup/user on my linux host for a group of files. Today I found out that CURL is rising a permission denied (only on browser access, works on SSH)
Couldn't send request: Failed to connect to <server_ip>: Permission denied
file is currently have 777 permissions. But I thinks it is related with user group/user.
ls -all result:
-rwxrwxrwx. 1 baknealdi psaserv 533 May 18 05:14 check.php
Listed users groups;
root:x:0:
psaserv:x:504:apache,psaftp,psaadm,nginx
psacln:x:505:
And I have read somewhere that selinux might be related with it.
sestatus result:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
I can give any other information, but I really don't know what is related.
If you want to use a password to access the SSH server, a solution for fixing the Permission denied error is to enable password login in the sshd_config file. In the file, find the PasswordAuthentication line and make sure it ends with yes . Find the ChallengeResponseAuthentication option and disable it by adding no .
To fix the permission denied error in Linux, one needs to change the file permission of the script. Use the “chmod” (change mode) command for this purpose.
This error comes up when using a wrong private key or no key at all when trying to connect via SSH. To resolve the problem, you should generate a new key pair and connect using that new set of keys.
Simply applying this line of code in the PHP configuration made it;
setsebool -P httpd_can_network_connect 1
which enabled http network connections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With