Skip to content
Snippets Groups Projects
Commit 6dfe36da authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'patch-jailkit_authorized_keys' into 'stable-3.1'

Config option for jailkit authorized keys

See merge request ispconfig/ispconfig3!867
parents 1d8cce6c 8394c296
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,7 @@ jailkit_chroot_home=/home/[username]
jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /opt/php-5.6.8/bin/php /opt/php-5.6.8/include /opt/php-5.6.8/lib
jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
jailkit_chroot_authorized_keys_template=/root/.ssh/authorized_keys
[vlogger]
config_dir=/etc
......
......@@ -489,7 +489,8 @@ class shelluser_jailkit_plugin {
if (!file_exists($sshkeys)){
// add root's key
$app->file->mkdirs($sshdir, '0755');
if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys'));
$authorized_keys_template = $this->jailkit_config['jailkit_chroot_authorized_keys_template'];
if(is_file($authorized_keys_template)) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents($authorized_keys_template));
// Remove duplicate keys
$existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment