Add shell access and scp support

This commit is contained in:
Daniel Winzen
2019-01-06 18:20:02 +01:00
parent b5d8b79b8e
commit c46a2584fa
7 changed files with 69 additions and 6 deletions

View File

@ -26,7 +26,8 @@ while($id=$stmt->fetch(PDO::FETCH_NUM)){
$reload[$firstchar]=true;
$enable_onion->execute([$id[6]]);
//add and manage rights of system user
exec('useradd -l -p ' . escapeshellarg($id[2]) . ' -g www-data -k /var/www/skel -m -s /usr/sbin/nologin ' . escapeshellarg($system_account));
$shell = ENABLE_SHELL_ACCESS ? '/bin/bash' : '/usr/sbin/nologin';
exec('useradd -l -p ' . escapeshellarg($id[2]) . ' -g www-data -k /var/www/skel -m -s ' . escapeshellarg($shell) . ' ' . escapeshellarg($system_account));
exec('/var/www/setup_chroot.sh ' . escapeshellarg("/home/$system_account"));
exec('grep ' . escapeshellarg($system_account) . ' /etc/passwd >> ' . escapeshellarg("/home/$system_account/etc/passwd"));
foreach(['.ssh', 'data', 'Maildir'] as $dir){