如何使用php启用linux支持用户的某些时间

I want to enable linux support user for 8 hours and then lock his login automatically.

Front end is built using PHP and below is what I have used ..

// Enabling Support
shell_exec("sudo passwd -u support");
// Time to Expire
$date = date("h:i:s A", strtotime('+8 hours'));
$timeat = substr($date,0,2).substr($date,9,11);
// Cron setup using 'at' command 
shell_exec("sudo at ".$timeat." -f /path/to/cron/disablesupport.php");

disablesupport.php has the below code.

//Locking Support
shell_exec("passwd -l support");

This didn't work. Please fix and help me with a solution.

Revise the PHP.ini file for custom time configuration.

For Ubuntu, the /etc/php5/apache2/php.ini file should be revised.

Change the line: session.gc_maxlifetime=28800

(28800 seconds = 8 hours)