Skip to content

Commit c058e40

Browse files
author
Till Brehm
committed
Create .ssh folder in web root.
1 parent db34dc0 commit c058e40

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,13 @@ function update($event_name, $data) {
705705
if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin');
706706
if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp');
707707
if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav');
708+
709+
if(!is_dir($data['new']['document_root'].'/.ssh')) {
710+
$app->system->mkdirpath($data['new']['document_root'].'/.ssh');
711+
$app->system->chmod($data['new']['document_root'].'/.ssh', 0700);
712+
$app->system->chown($data['new']['document_root'].'/.ssh', $username);
713+
$app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname);
714+
}
708715

709716
//* Create the new private directory
710717
if(!is_dir($data['new']['document_root'].'/private')) {

server/plugins-available/nginx_plugin.inc.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,14 @@ function update($event_name, $data) {
552552
if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin');
553553
if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp');
554554
//if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav');
555-
555+
556+
if(!is_dir($data['new']['document_root'].'/.ssh')) {
557+
$app->system->mkdirpath($data['new']['document_root'].'/.ssh');
558+
$app->system->chmod($data['new']['document_root'].'/.ssh', 0700);
559+
$app->system->chown($data['new']['document_root'].'/.ssh', $username);
560+
$app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname);
561+
}
562+
556563
//* Create the new private directory
557564
if(!is_dir($data['new']['document_root'].'/private')) {
558565
$app->system->mkdirpath($data['new']['document_root'].'/private');

0 commit comments

Comments
 (0)