You are not logged in.

#1 2019-02-24 17:08:42

SuperDuck
Member
Registered: 2014-06-25
Posts: 7

[SOLVED] /tmp rights

Hi,

Since few days, I have trouble with my /tmp rights.

Indeed, I cannot modify a text file if I'm not the owner of the file, even if I'm the root user.

Let me explain :

  • As root user I create a file :

[root@archmachine ~]# touch /tmp/toto
  • I change the file owner :

[root@archmachine ~]# chown 1000:1000 /tmp/toto
  • As root, I try to add text, but it fails :

[root@archmachine ~]# echo "toto" >> /tmp/toto
-bash: /tmp/toto: Permission denied
  • mount result :

tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=4194304k)
  • It works, if I change the owner of the file before trying to modify :

[root@archmachine ~]# chown root:root /tmp/toto
  • ls :

-rw-r--r-- 1 user user 0 24 févr. 18:01 /tmp/toto
  • rm works :

[root@archmachine ~]# rm /tmp/toto

Does anyone have an idea?

Thanks in advance!

Last edited by SuperDuck (2019-02-24 17:23:07)

Offline

#2 2019-02-24 17:12:03

loqs
Member
Registered: 2014-03-06
Posts: 17,572

Offline

#3 2019-02-24 17:20:38

SuperDuck
Member
Registered: 2014-06-25
Posts: 7

Re: [SOLVED] /tmp rights

Well done Loqs, indeed it works :

  • Check my fs.protected_regular parameter :

[root@archmachine ~]# sysctl fs.protected_regular
fs.protected_fifos = 1
  • Disable it :

[root@archmachine ~]# sysctl -w fs.protected_regular=0
  • Try it :

[root@archmachine ~]# echo "toto" >> /tmp/toto

It worked perfectly, thanks!

Last edited by SuperDuck (2019-02-24 17:25:16)

Offline

Board footer

Powered by FluxBB