1

I was trying to increase my mouse scroll speed by following https://github.com/tkkcc/libinput_patch which requires modifying a file. Should be easy...

$ echo 6 > /tmp/libinput_discrete_deltay_multiplier
bash: /tmp/libinput_discrete_deltay_multiplier: Permission denied

Nothing a sudo wont solve right?

$ sudo bash -c 'echo "6" > /tmp/libinput_discrete_deltay_multiplier'
bash: line 1: /tmp/libinput_discrete_deltay_multiplier: Permission denied

Checks permisions

$ stat  /tmp/libinput_discrete_deltay_multiplier
Access: (0666/-rw-rw-rw-)

At this moment I'm at the limit of my abilities. How can I change this file and why it doesn't let me change it even with root privileges? I tried many approaches and search engines are no good on this one.

Edit: Tried

$ echo 6 | sudo tee /tmp/libinput_discrete_deltay_multiplier
tee: /tmp/libinput_discrete_deltay_multiplier: Permission denied
$ dmesg | tail
dmesg: read kernel buffer failed: Operation not permitted
AdminBee
  • 21,637
  • 21
  • 47
  • 71
welkam
  • 11
  • 2
  • 1
    Does this answer your question? [Redirecting stdout to a file you don't have write permission on](https://unix.stackexchange.com/questions/1416/redirecting-stdout-to-a-file-you-dont-have-write-permission-on) – Andy Dalton Jul 07 '21 at 20:25
  • tee: /tmp/libinput_discrete_deltay_multiplier: Permission denied. sadly I tried with tee already – welkam Jul 07 '21 at 21:01
  • Can you post your exact command with `tee`? The answers in the link posted by @AndyDalton work for me, even after changing the permissions to 0600 and owned by root. – ajgringo619 Jul 07 '21 at 22:05
  • Is there anything in the kernel messages? `dmesg | tail` – berndbausch Jul 07 '21 at 22:54
  • @AndyDalton, note that what they're doing there with `sudo` is to have the sudo'ed Bash do the redirection, essentially the as in [this answer](https://unix.stackexchange.com/a/1418/170373) in that same question. – ilkkachu Jul 07 '21 at 23:06
  • 1
    If it's Linux, check `lsattr /tmp/libinput_discrete_deltay_multiplier`. Also `mount` or `findmnt` to check what file system `/tmp` is (or `/` if `/tmp` is part of it) – ilkkachu Jul 07 '21 at 23:08
  • 1
    `sudo dmesg` might help – ilkkachu Jul 07 '21 at 23:08
  • This is strange ```lsattr /tmp/libinput_discrete_deltay_multiplier``` lsattr: Operation not supported While reading flags on /tmp/libinput_discrete_deltay_multiplier – welkam Jul 07 '21 at 23:11
  • @ilkkachu Yep, you're right; I didn't notice that. – Andy Dalton Jul 08 '21 at 01:51
  • 1
    Seems this one: https://unix.stackexchange.com/q/503111/315749. To make sure, and to also make this Q more likely to help other users, could you please add the output of `ls -l /tmp/libinput_discrete_deltay_multiplier` (to see the file's owner and group) to it? Also, what operating system are you using? – fra-san Jul 08 '21 at 05:42
  • ...and the output of `ls -l /tmp` would be useful too, to make sure it is a sticky directory everyone can write to. A way to write to that file should then be to impersonate the file owner: `sudo -u file_owner sh -c 'echo 6 > /tmp/...'` – fra-san Jul 08 '21 at 05:57
  • I think that would be `ls -ld /tmp`, @fra-san – roaima Jul 08 '21 at 07:16
  • @roaima Yes, definitely. Thank you! – fra-san Jul 08 '21 at 07:19
  • Please don't edit the question to include the answer - I have rolled back that edit so that the question conforms with site guidelines. The link to the duplicate is meant to guide visitors to the solution. – AdminBee Jul 08 '21 at 10:35

0 Answers0