Thursday, September 1, 2016

The Securetmp Script


This is a well known script in cPanel. This script can be used for two purpose. One is for prevents users from the use of malicious code in the /tmp and the /var/tmp directories. All users can write to the /tmp directory (with the securetmp in place) with noshell, normal, and jailshell accounts. The other use is to increase the /tmp partion.



Following detail would help to increase /tmp partition on cPanel.



Steps:



Login to server by SSH.



Stop the services using /tmp partition, those usually are cpanel, mysql and httpd.



/etc/init.d/cpanel stop

/etc/init.d/httpd stop

/etc/init.d/mysql stop





Make sure that no other processes are running using /tmp partion. This can be checked by following command.



lsof | grep /tmp





If you find any proceess, stop them by the PID.



Now, umount /tmp and /var/tmp, run this commands



umount -l /tmp

umount -l /var/tmp



Backup your current /usr/tmpDKS directory



mv /usr/tmpDSK /usr/tmpDSK.bkp



Edit the file /scripts/securetmp



In the file /scripts/securetmp you can find a section called #Global Variables with this line:



my $tmpdsksize = 512000;


You should be able to edit the file and increase the size as your wish.



Save the file



Re-create the /tmp partition by running by following command



/scripts/securetmp



Start cPanel, httpd and mysql service



Check the /tmp partion now.





Thats all



No comments:

Post a Comment