You are not logged in.

#1 2017-06-25 19:26:18

daankata
Member
Registered: 2017-05-21
Posts: 47

Binding /var/tmp to /tmp and /dev/shm

I've read in several places that it is recommended to bind-mount /var/tmp to /tmp. I have added this entry on the last line of the /etc/fstab file

<file system> <dir>       <type> <options>                                <dump> <pass>
/tmp          /var/tmp   /none    rw,noexec,nosuid,nodev,bind             0      0

I have seperated the /var partition during installation. Is it recommended to bing /var/tmp to /tmp?

Also I have read about mounting /dev/shm with nodev,noexec,nosuid? Why is this needed and how to do it in fstab?
Thank you! smile

Last edited by daankata (2017-06-25 19:28:14)

Offline

#2 2017-06-25 20:00:53

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: Binding /var/tmp to /tmp and /dev/shm

daankata wrote:

I've read in several places that it is recommended to bind-mount /var/tmp to /tmp. I have added this entry on the last line of the /etc/fstab file

<file system> <dir>       <type> <options>                                <dump> <pass>
/tmp          /var/tmp   /none    rw,noexec,nosuid,nodev,bind             0      0

I have seperated the /var partition during installation. Is it recommended to bing /var/tmp to /tmp?

You are asking for responses to information supplied from unspecified sources which gave unspecified reasons.
file-hierarchy covers the expected differences between /tmp and /var/tmp

daankata wrote:

Also I have read about mounting /dev/shm with nodev,noexec,nosuid? Why is this needed and how to do it in fstab?

Same issue to the why as above.  How is covered in fstab.   Just to note /dev/shm should be nodev,nosuid by default.

Offline

#3 2017-06-29 05:55:40

severach
Member
Registered: 2015-05-23
Posts: 198

Re: Binding /var/tmp to /tmp and /dev/shm

The only reason you'd want to change /tmp to permanent storage is using an old program that is not aware of the limitations and benefits of tmpfs. Wiping /tmp on every boot is not only a valuable feature, modern software may depend on it.

Offline

#4 2017-06-29 06:18:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,881

Re: Binding /var/tmp to /tmp and /dev/shm

He wants to make /var/tmp tmpfs - bad idea.
In addition, wherever one picked up "/none" [sic!] is a terrible source for anything ...

Mounting /dev/shm can remove an attack vector on servers - doing that on a desktop *can* cause you trouble, notably if you lack experience.
It's though not commonly used to store/run executable files.

Offline

Board footer

Powered by FluxBB