Users can't upload files, even with permissions set to them using vsftpd - linux

I have a cloud hosting linux solution. I had vsftpd working on it, but after having issues and tinkering with a lot of settings, I now have an issue where users can login using FTP and connect to the correct home directory, navigate within it, download files but they cannot upload files to the server. They get a time out error, which appears to be a permissions error, but I can't narrow it down any more than that. /var/logs/syslog gives nothing away.
The folders belong to the users. The parent www folder is set to 555. Can anyone help with this issue at all?
Cheers,
T

Try to set the permissions to 755, 555 doesn't allow writing for anyone. Are your user and group different?
You also may need to enable logging for FTP server. The time out error may include some other errors, not only permission denied.
To have extended logging change the variables in your ftp config file:
dual_log_enable=YES
log_ftp_protocol=YES
xferlog_enable=YES
syslog_enable=NO
and check the log file name there.

you must create a folder into user folder (Example : /var/www/user1/upload).
and set permission 777 (Example : chmod 777 /var/www/user1/upload).
then upload file into this folder.

Related

apache2 on ubuntu webserver rejects permission to access any other file than the delivered index.html

I am trying to set up a webserver running on Ubuntu. I have installed Apache and changed the root directory to an other directory within /var/www/. When I copy the index.html provided by Apache to that directory, I can access that file via remote webbrowser. But if I want to use a different index.html file, even really basic ones, I get an error: "Forbidden You don't have permission to access this resource". I have also tried to download that html, alter just a few lines and put it back on to the server with the result that it also shows that error. If I rename the initially provided index.html to index2.html I can still access it. I do not understand how it is possible that only this exact file is working.
I have tried to grant more permissions with Directory and restarted Apache but it won't work. I am rather new to Linux and Apache, can only use the terminal on my webserver and I do not know what else to do. Please help.
Change the permissions on the file, too, not just the folder. Pretty sure this fix it.
For diagnostic correction, allow permission for all by typing:
sudo chmod -R 777 /path/to/index.html

Is execute permisson required in uploading file by scp?

I created a web application directory and app in the directory.
And, they have 776 permission and their group is apache:apache.
I'd like to allow others to upload modules by scp.
But,I want others not to execute programs.So,I don't give "x" others , but it doesn't work. They cant upload file and permisson denied.others group is "xxx".
I think if others have read and write permission , they can upload file. What is wrong?
In order to add files to a directory you need both write (+w) and execute (+x) permissions.
See this answer for how file permissions work in Linux:
https://unix.stackexchange.com/questions/21251/execute-vs-read-bit-how-do-directory-permissions-in-linux-work
The execute permission on a directory does not imply files in that directory are made executable.

/temp/ directory disappears cpanel

I have a dedicated server running Linux/Apache with cPanel. On one of my website's users are able to register and upload images.
However, over the last few days, i have received complaints that users cannot upload any media. When I check the /images/ directory I see that the /temp/ folder is missing.
So I re-created it and set the permissions to 0777.
Once that is completed all works fine. But I cannot understand why the directory is being removed. No one else has access to the site and I do not see anything in my error logs that show anything unusual.
Any ideas why this may happen?
Thank you
You need to check your PHP Script has code to unlink(dir) or Something
and Check cron list whether you have added any CRON to remove the TMP folder.
for Write permission 755 is enough If you are using Fcgi php handler, cgi, dso. Have a try 755 permission with one of the listed Handlers.

How can I CHMOD files/directories on Windows Azure?

I am using FileZilla FTP to right click and change a directories File Permissions as I do on many other sites/servers. For some reason this is not working in Windows Azure. It outputs in FileZilla "500 'SITE CHMOD 777 (mydirectory)': command not understood"
Any ideas?
The Windows Azure portal has a "Console" for websites where you can execute some shell commands. One of them appears to be chmod (fileutils) 4.1. I was able to modify the permissions on a folder using this:
chmod -R 744 myfolder
I found a hack solution to delete files on Azure:
Stop your website from the management console (https://manage.windowsazure.com)
Open up the FTP site in Filezilla
Rename the directory that has the problem to anything else (Possibly an optional step, I dont know)
Delete the renamed directory
Restart your website.
That seems to do it.
Windows Azure Websites is a Windows Server based server. Thus, file permissions don't work like in Linux (as #SLaks already mentioned).
However, the account your scripts (PHP/ASP.NET/node.js) are executed under has full access to the folder /site/wwwroot, as does your FTP user. Meaning that from your PHP you can do all fully privileged file access operations - Read, Write, Delete, Create, Create directories.
What you cannot do, and cannot be changed, is to execute scripts (which 0777 would give you in Linux).

How to allow file uploading outside home directory with SSH?

I'm running a Fedora 8 Core server. SSH is enabled and I can login with Transmit (FTP client) on port 22. When logged in, I can successfully upload files to the users home directory. Outside the home directory I can only browse files, not upload/change anything. How can I allow file uploading to a specific directory outside the users home directory?
an easy method is to grant the user rights to the folder you want them to be able to upload to, then add a symlink (link -s) from their home folder to the destination.
You can also just use
scp file user#server:/path
which will let you upload to any directory you have permissions to
file is the file to copy
user & server should be obvious
/path is any destination path on the server which you have rights to; so /home/user/ would be your likely default home folder
You need to make those directories writable by the proper users, or (easier) that user's group. This is of course a huge security hole, so be careful.
HI,
Give the FTP user write permission on the directory where you want to upload your files.

Resources