How to secure tmp folder?
Hi
I want to secure tmp folder and want to stop any execution there. Please guide me for that Thanks PS I am getting lot of 500 and 502 error here. Please fix it. For every click i am getting it |
If /tmp is on it's own partition, you could add the "noexec,nosuid,nodev" mount options in /etc/fstab. It won't make it impossible for a person to execute files (a clever person can get around it) but can prevent accidental execution.
For example: Code:
sudo mv /tmp /oldtmp On older versions of linux, /lib/ld-linux.so /tmp/<program>, would run the program. This hole has been plugged. For debian distributions, installing packages requires files in /tmp to be executable. You need to modify the system to remount /tmp before install and again after. --- /tmp should just be used for temporary files. Such as modifying a file, and needing to redirect to a temporary file, before replacing the original: sed 's/john/mike' file >/tmp/tmpfile mv /tmp/tmpfile file You shouldn't be saving things there. Since you want to make /tmp more secure, delete all files in /tmp when you power down. Most disto's have a setting to do that. A malicious file will be removed then. |
All times are GMT -5. The time now is 04:48 AM. |