Azure CentOS web root folder folder permission issue - azure

I am able to login to my SSH account, then while creating a file in the location /var/www/html it give me permission error . It seems that the owner of this folder is root. How can I able to get access to this folder to upload files ?

According to your description, if you want to upload your files to Azure VM, you could upload files to your /home/user's folder, then copy them to /var/www/html.

Related

Apache: wrong owner and permission of uploaded file

I have a website running on apache server.
Yesterday, I logged in to my server and restarted passenger, apache server.
I restarted using command:
touch /tmp/restart.txt
After that, I noticed that the new uploaded files are changed ownership to paelz (my username) and permission to -rw-------. The files were uploaded by some other users using the website.
The older files has owner apache and permission: -rw-r--r--.
As a result, the website cannot load the new uploaded files. However, it can load the older ones.
If I run chmod 644 on the new uploaded files, the website can load the files normally. However, I want a permanent solution.
I want the new uploaded file owned by apache and has permission as the old ones.
My question is what caused this issue and how can I fix it.
Finally I found the answer.
It is not related to apache. It is related to passenger instead.
https://stackoverflow.com/a/4232091/1319283
By default, passenger will run your app as the user who owns the
config/environment.rb or config.ru file, see
The config/environment.rb is owned by my account so passenger will run the app as my account.

Linux folder permission denied

I have a folder in /srv/backups. I have a users group that has access to the backups folder with rwx access.
I have added myself to the users group
but when i try to cd into the backups folder i keep getting a permession denied.
Any ideas on what im doing wrong?
The reason is that your groups don't get updated until you log out and back in.

Copy site but preserve permissions

I wanted to copy my Drupal site to another location (VDS), I got full backup from my provider, (in tar.gz), untarred and ungzipped it, deleted some folders, zipped it again in 7zip format, then copied it with sftp to /var/www on VDS and unzipped, but all permissions now are read-only and so Drupal doesn't work at all cause it cannot acess files.
Can anyone tell when I lost my permissions, the right way to migrate to my VDS or (and) how can I manage with my corrupted-permission Drupal now (maybe I just can change them?)
Read only permission is generally fine for a Drupal site, except for the upload folder (it's nomally called files and in can be in sites/default or in sites/YOUR_SITE_CONFIGURATION_FOLDER or wherever you set it to be in admin/config/media/file-system). The files folder, and every subfolder it contains must be writable from the web server, so if your web server is running as the www-data user (the standard user for Apache in Ubuntu, other systems may differ) you can for example do
chmod -R o+w sites/default/files
chown -R www-data sites/default/files

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

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.

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