Permission Denied to write /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger - linux

I am trying to run the following command on my Ubuntu machine
root#manav-R761-c:/# ls -la /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
ls: cannot access /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger: No such file or directory
root#manav-R761-c:/#
root#manav-R761-c:/# echo 'hash:stacktrace:bytes_req,bytes_alloc' > /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
bash: /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger: Permission denied
I am logged in as root, then why I am not able to create trigger file and write to it?

Related

unable to add ssh/knownhost

I am unable to add any file into my .ssh directory
the commandnd
ssh -T git#gitlab.com
returns me
"git#gitlab.com: Permission denied (publickey)."
I am unable to touch the file

Permission Denied when trying to read file w/644 permission

I am trying to write a PHP script for a Web server (lighttpd) to read a file in another user.
The Web server runs under user http:
http 1929 336 0 Nov20 /usr/bin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
The file the script is trying to read has the following permissions:
-rw-r--r-- 1 pi www-data 721 Oct 30 05:20 /home/pi/bmSunday
Which I thought meant that any user can read it.
The fopen in the script results in a Permission denied:
Warning: fopen(/home/pi/bmSunday): failed to open stream: Permission denied in /srv/http/p1/index.php
I am running Arch Linux.
uname -r
displays:
4.4.32-2-ARCH
What permissions do I need to set on the file so that user http is allowed to read it?
By the way, am I correct in assuming I can also test the permission via:
sudo -u http cat /home/pi/bmSunday
Using the above command, the result is:
cat: /home/pi/bmSunday: Permission denied
The permissions on the directory are probably wrong, http probably doesn't have execute permission. Add world execute permissions:
chmod o+x /home/pi
You (as a user) in your example have no execute permissions. So yes chmod +x file. Keep in mind this adds execute to both users others.
If you give all other user execute permission on home directory of other users it compromise security to all other user. it will be better if you give permission only http user by acl.
$ setfacl -m u:http:r-x /home/pi

ls and chmod not working on a nfs mounted file

I mounted a directory using nfs. I am able to cd into the mounted directory and able to list the
one file in the directory. But when I try a ls -li on the file, it keeps failing with
ls: rst_dst/testnew1: Permission denied.
I tried to chmod the file but it keeps failing with chmod: failed to get attributes of 'rst_dst/testnew1': Permission denied. Even the stat command keeps failing with 'Unable to stat the file'.
I tried a sudo ls/chmod but it fails with the same errors.
I am able to chmod the file on the actual machine hosting the directory. But unable to read/write/modidy the permissions through the mounted directory.
Am I missing something?
On hosting machine check file /etc/exports which permissions you allow.
On guest machine check your mount command or line in /etc/fstab with which permissions you are mounting it.

Permission denied for root shrc

Whenever I open the terminal on my Centos5.1, I always get this error
/root/.cshrc Permission denied
and then I can't use networking commands (ip,ifconfig,...) because they are reported as unknown commands.
Verify that you have permissions to read .cshrc To do that issue:
ls -l /root/.cshrc
If the output begins with to dashes it means that you don't. To give yourself read permission to this file issue:
chmod +r /root/.cshrc
Now if you run ls -l /root/.cshrc the output should start with -r.

ant Permission Denied problem

After extracting and saving the ant files into an opt/ directory and setting the path variable
to $ANT_HOME/bin
I ran the following command on a CentOS 5
ant -version
and I am getting the following error
-bash:/path/opt/apache-ant-1.8.2/bin/ant: Permission denied
Is there some permission I am supposed to set or some typical source of this problem?
Thanks!
If you own the file, try
chmod u+x /path/opt/apache-ant-1.8.2/bin/ant
If someone else owns it, either sudo or become root then
chmod 755 /path/opt/apache-ant-1.8.2/bin/ant
You need to have execute permissions on the file; the first gives execute permissions to the owner only and is probably preferable if you own the file and are the only one that uses it. The second requires root privileges and gives execute and read permission to everyone, plus write permission to the owner.
You can view the current permissions and ownership of the file by running ls -l /path/opt/apache-ant-1.8.2/bin/ant.

Resources