how to change file permission to view image - linux

For some reason when I SCP'd my files to my server an image did not get the same permission as other files that were uploaded. For this reason I am getting a 403 forbidden error.
My file permissions look like:
How can I set the permission of ima-1.png to have the same permissions as the other files above it?

run the command:
chmod 644 ima-1.png
That will provide the same permissions as the files above it.

Related

How to resolve /bin/bash: Permission Denied

RHEL8.3 OS is being used on server, Yesterday i have accidently executed command chmod 644 /* from /usr/share/fonts directory after command execution i am not able to access server with ssh or on putty.
Admin is trying to connect to server with root user but he is getting error /bin/bash: Permission Denied.
Please suggest how to restored permissions or resolve issue.
Refer to here, 644 means you can't even execute the file, with or without root.
Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.
Could you try sudo chmod 755 /* or without root chmod 755 /*?
Also, you may try this.
If nothing works, reinstalling your system will be the only choice left.

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.

permission denied while copying eventhough necessary permission exist

I have a file(file) with permission 500. In Linux, I tried to copy (using cp) that file into a folder (a) whose permission is 600. Even though folder have write permission, I am getting " cannot stat `a/file': Permission denied error.
Could anyone explain why is it so?
Is it because directory does not have executable permission ?
Execute bit allows the affected user to enter the directory, and access files and directories inside.
Plse see http://www.hackinglinuxexposed.com/articles/20030424.html
https://unix.stackexchange.com/questions/21251/why-do-directories-need-the-executable-x-permission-to-be-opened for further info

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.

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.

Resources