Permission denied on directory with specific name - bash

This is a weird one... On Ubuntu 14.04 I have a directory called /lib. As root, or on the server as a user with group privileges, I can write to this directory. Over FTP as the same user with group privileges I cannot, I get a Permission Denied error...
If I rename the /lib directory to anything else (in this case /lib-new) I can write to the directory over FTP.
What could be causing a Permission Denied error based purely on the name of the directory?
I've checked and tested the permissions of the directory (777, 775, 755, 664 and 644) as well as the directory above (/public_html - the root directory for the server) and nothing helps, unless I rename the directory something other than lib.
Please help, as SSH-ing into the server to make changes to anything within /lib is time consuming!
EDIT: The FTP server I'm using is ProFTP if it helps.

Try adding RLimitChroot off to /etc/proftpd.conf. May need to restart X for this change to take affect. By default, I think it will do the same thing to /etc directory as well.

Related

EC2 AMI instance is resetting folder permission everyday

I have a log folder /var/www/app/logs/ in an EC2 AMI instance. My PHP aplication is writing logs there, however every day I must logon and do chmod in order to avoid the error message that the folder is not writable:
$ sudo chmod 7777 -R /var/www/app/logs/
For some reason the instance this permissions are reset every morning automatically by some unknown process. Is there a way to make this change permanently?
My guess is that you have some log rotation rules set up for this directory, which might be responsible for the permission change.
And, don't set the permissions to 777, definitely. Either change the owner of the directory to your application user, or add your application user to a group which has write permission to the directory.
Not sure whether is the best solution, but solves my problem. Edit the /etc/httpd/conf/httpd.conf file and change:
User apache
By:
User ec2-user
Then restart the webserver.

Permission denied when starting .bashrc on ubuntu on windows

I wanted to add a path to my .bashrc file on Ubuntu on Windows.
Since then, I get always:
/home/gian1312/.bashrc: Permission denied
I deleted all my changes. It did not help.
Then I opened the .profile file to add the path there. --> Now I get:
/home/gian1312/.profile permission denied
I deleted all my changes. All edits were made by Notepad++ in Windows.
I am looking for a solution for several days. Probably a reinstallation would help but as long as I do not know the reason I do not want to risk to face the same problem.
Best Regards and thanks a lot
Gian
The error simply says that permission denied. Since the question is not completely clear, the following things can be tried:
1) Check the permission of the file ".bashrc" and ".profile" and make sure it is 0644
2) Check the upper level directory permission (here the folder /home/gian1312) and make sure it is 0755.
3) If the first two are fine, then you need to check the permission of the "path" which you are trying to add and it should have enough permissions to be readable by the user "gian1312"
Editing the answer as per the below comment:
To change the permissions, please run the below commands:
chmod 0755 /home/gian1312
chmod 0644 /home/gian1312/.bashrc
chmod 0644 /home/gian1312/.profile

OpenShift Online home folder no write permissions

I'm running Jenkins on OpenShift Origin, but no write permissions in home folder. This likely breaks some programs for me. Can you please help me with
moving home directory to location with write permissions, or
allowing write permissions in my home folder, or
telling Gradle in Jenkins to use different folder.
The only directory writable is the OPENSHIFT_DATA_DIR, this is the environment variable you can use to reference it.

Joomla extension install from URL error: Archive does not exist

I am trying to install a package from URL into my local server and I am getting this error:
Error
Archive does not exist
Warning
JFolder: :files: Path is not a folder. Path: C:\xampp\htdocs\Joomla\tmp\install_53170ad5161e0
JFolder: :folder: Path is not a folder. Path: C:\xampp\htdocs\Joomla\tmp\install_53170ad5161e0
JFolder: :files: Path is not a folder. Path: C:\xampp\htdocs\Joomla\tmp\install_53170ad5161e0
JInstaller: :Install: Cannot find Joomla XML setup file
The tmp paths are correct and the remote file URL link is correct too. I've also tried by clearing the tmp folder but still does not help. The package installs correctly when the package file is uploaded.
Does anyone know what's happening?
If you are using Linux
You may need to fix the directory permissions. Check if there is any directory of which CHMOD is not 0777. If there are folders which their CHMOD value is lower than 0777 set them to 0777. After installation you have to change chmod back to 0755
Even though this post is quite old I hope that someone searching for a solution will stumble upon this question and answer:
I had the same problem when installing and updating Joomla on a Windows host, problems were related to directory permissions on various directories like "tmp", "modules" etc not being set. When I used the FTP client's chmod functionality the server responded with 504 Command not implemented for that parameter (showing in green instead of red in my FTP protocol so I ) so permissions were never changed. I had to alter the security settings using the hoster's web interface, after that installing packages worked as expected.
only for this folder:
chmod 777 /opt/lampp/htdocs
OR
project folder -
chmod 777 /opt/lampp/htdocs/project_name
in /var/www/you_site/httpdocs/configuration.php change value:
$ftp_enable = '0'; set 0 from 1

Codeigniter not creating any log files

Under config.php I have:
$config['log_threshold'] = 4;
$config['log_path'] = '/home/myaccount/logFilesFolder';
In index.php I have:
error_reporting(E_ALL);
The only way I can seem to get anything to log is if I chmod that directory to rwx (777), which doesn't seem right to me. That and it doesn't see to be logging all the errors.
In my local/dev environment it seems to be working but on my production server nothing is being logged. I can't seem to figure out why.
The log filename in the configuration settings needs a trailing "/" above making sure the webserver process has writeable access to the directory.
Change the logs owner and group to what owner/group your live web server is running, give it write perms and it should work. I take it that in your local/dev server your CI folder is owned by you that is why you need to chmod it to 777 to make it work.
The directory where you want the log files to be saved needs to be writable.
I have tried a lot of solutions and finally what worked for me was this:
Open system/libraries/Log.php
and change the following lines;
set the value of: $this->log_path to a writable directory, preferably home directory so that there are no permission issues. If you want to change the filename also, search for the variable $filepath and change the name.
Example:
$this->log_path = '/log';
touch /log/
restart the webserver.
The logs will start coming.
I have tried a lot of other options, none worked, this is not neat approach but at least I can see my logs now.
I had the same problem with my Codeigniter 4 project. The log was created successfully in my local window machine but was not creating on the remote Linux machine. I was using a custom path to generate log files under the 'app' folder. So what I did is to change the settings in my config/Logger.php file back to
'path' => WRITEPATH.'logs/',
and it created the log files under writeable/logs folder.

Resources