Commit 74b3b31f authored by Helmo's avatar Helmo

Config option for jailkit authorized keys, #4901

parent 04d8e6f6
......@@ -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('/root/.ssh/authorized_keys')) $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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment