Permission in zabbix to access restricted files - permissions

I'm trying to get the checksum of some files in my servers to monitor their changes. I cannot change there permissions because they're so important. I've heard that I can use ACL method for using
vfs.file.cksum[MyFile,sha256], But I don't know how to do that.
I have CentOS7 and Ubuntu20.04 and Zabbix 6. Now I get this error: "Cannot open file: [13] Permission denied".
here might be other ways I'm not thinking of, and it's my pleasure to use your advices.
Thank you.

Related

Execute VBScript from ssh (cygwin). Permission denied: 'CreateObject'

I'm using a VBScript to convert remotely a file from docx to pdf but I have problems with Window's permissions. I think the ssh user on cygwin sshd server has not administrator permission.
This is the error that the system show me.
Microsoft VBScript runtime error: Permission denied: 'CreateObject'
If I try to execute the script locally then everything works fine.
How can I config the ssh user on cygwin to execute the script as administrator?
I looked on google but I did not find anything.
Thank you
Would need more information on your environment, but here are some things that will help you resolve your issue.
Check what user is running the cygwin service. You can make it administrator or give the user more permissions(I recommend the later)
Use Process monitor to see what user is trying to execute the statement and give that user permissions.
Give the COM Object you are trying to call, Read+Execute permissions for Everyone or just the user running the script.

What should the permissions and ownership for Drupal on LAMP stack?

What has me confused is why a directory or part of my Drupal site to suddenly return the message of "Forbidden" - that I, as first use, cannot access various parts of the site in the admin area. I changed the permission on the default/sites/files directory to 777. That probably is giving to too much access to everyone. However, it was only after doing that, that I got a message of Forbidden - that I don't have access to various parts of the admin area. I am the first user.
I changed the permissions on this directory because when I tried to update some modules, I got an error that file could not be created.
I have cpanel/whm on a dedicated vps server. So, one issue is how to find out what the user and group ownership should be on a server that hosts various domains through cpanel. It appears that for other accounts have user:owner permissions that match the account name. I am not sure if the default group:owner should remain as www-data:www-data for example, on Ubuntu or if cpanel/whm says, "make the apache group and user equal to the account name."
Thanks in advance for any help,
Bruce
First of all, I'm going to assume you're talking about Drupal 7, but really, there's little difference in this case.
Try reading about permissions here
Its very simple that the folder should have user:user ownership and correct permissions with folders having 755 permissions respectively. The server might be running on suphp hence you cannot have wrong user with wrong permissions.

ssh permission denied (publickey) when trying to access ec2 from different computer

I am trying to access an ec2 instance using a different (mac) computer. In order to do so, I created a new keypair, used chmod 600 to set the permission, and then used ssh-add. When I try to ssh into my ec2 instance, I get "permission denied (publickey)". I'm sure my error is something idiotic and simple, but I can't seem to find it, can anyone help me out?
You need to ensure the ~/.ssh/id_rsa.pub (if it's an RSA key) from your Mac is appended to the ~/.ssh/authorized_keys file on the target machine. Normally, if this is a default Amazon API, the user is "ec2-user" -- ~ec2-user/.ssh/authorized_keys
REMEMBER TO APPEND and not remove other entries in that file -- else, you risk locking yourself out of that machine ...
is your private key on the new computer?
You need to put that on the computer you ssh in with. I usually keep mine on a flash drive.... I am not running linux atm so i forget the default directory it checks. Maybe this joggs your memory some. I think the directory would be like ~/.id_rsa/ or something?

Permission denied when creating a folder

I am creating a directory in php it is working nicely in localhost but when I run in my server am getting error as
Warning: mkdir() [function.mkdir]: Permission denied in D:\Hosting\8089251\html\songs\test.php on line 12
How to give permission to server? I saw the php info in my server the virtual directory support is disabled? Is beacuse of that I am not able to create a directory? if so tell me how to enable virtual director support
How to give permission to server? I saw the php info in my server the virtual directory support is disabled? Is beacuse of that I am not able to create a directory? if so tell me how to enable virtual director support
It's not. The reason you can't create the directory is a very simple one: you don't have the permission to do so as stated in the error message. Generally, this means that the user PHP is running under isn't the same as the that owns the directory you're trying to create the directory in.
If your server is under your control, please read up on how permissions work under Windows (I imagine you'll have to add a group that has control over the directory). This stuff is important, so if you do have your own server, be sure to read and understand how permissions work, or your server will be ruined in the quickest of times.
If your server is actually maintained by someone else, give them a call. If all permissions are correct, mkdir should be able to create a new directory, so apparently the permissions aren't correct. If the server is not under your control, there's nothing to do about it other than telling the one who maintains the server to get his permissions straight.

should apache upload dir have 777 permissions or belong to www-data user?

I'm running apache and my php site uploads images to the server. should apache upload dir have 777 permissions or belong to www-data user? How would this affect backing things up?
I think read + write permission is enough. read for backup, write for upload. It seems that no one ever need to execute anything.
And you should only grant permissions to who really need them. For example, grant write permission to www-data. And if you use another-user to do back up, only grant read permission to another-user.
You'd better avoid using 777
That depends on what you need from it. You should always use the most restrictive permissions that will let you do what you need.
Read the man page for chmod(1) to learn what the various permission bits mean. And maybe provide some more detail about your situation, so someone can provide a specific answer for you.
First and foremost the apache server needs to run as a non-privileged user. Second the upload directory should only need 600 as the permission (rw) iirc. This will allow the user that is running apache to write to that directory. The practical attack against a web server is to trick it into writing to a directory and having it execute the code that is placed there.