Secure /tmp partition on a VPS

To secure the Virtual Private Server (VPS) tmp partition refer to the followings steps one by one carefully.

First login in to VPS as a root user.

1) Open the the /etc/fstab file and add the following line in /etc/fstab but make sure that no duplicate entry is already present for /tmp if any entry is present then remove it and add the following.

none /tmp tmpfs nodev,nosuid,noexec 0 0

2) Save the /etc/fstab file and reboot the VPS. As soon as server up and running the server gets mounted /tmp partition with the nosuid and noexec.

3) Now make sure that /tmp partition having correct permission

chmod 1777 /tmp

Check the mount point values now by running the simple mount command.



About Anant 386 Articles
Senior technical writer