Friday, May 3, 2024
239
rated 0 times [  239] [ 0]  / answers: 1 / hits: 266941  / 3 Years ago, wed, september 15, 2021, 2:24:32

When using sudo to allow edits to files, I regularly get 'permission denied'.



For example, my mouse is jittery and sluggish, so I want to disable polling:



sudo echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf


I'm prompted for a password, and then get:



bash: /etc/modprobe.d/local.conf: Permission denied


So I tried to do a temporary change to disable polling by using:



sudo echo N> /sys/module/drm_kms_helper/parameters/poll


Yet again the system responded with:



bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied


Any ideas?


More From » command-line

 Answers
4

Output redirection (via the > operator) is done by the shell, not by echo. You have to login as root



sudo -i


Then you can use redirection



echo N> /sys/module/drm_kms_helper/parameters/poll


Otherwise you can run bash string with sudo



sudo bash -c "echo N> /sys/module/drm_kms_helper/parameters/poll"

[#33616] Thursday, September 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nquirewha

Total Points: 256
Total Questions: 109
Total Answers: 122

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
;