Skip to content

Commit 74b3b31

Browse files
committed
Config option for jailkit authorized keys, #4901
1 parent 04d8e6f commit 74b3b31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jailkit_chroot_home=/home/[username]
140140
jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
141141
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
142142
jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
143+
jailkit_chroot_authorized_keys_template=/root/.ssh/authorized_keys
143144

144145
[vlogger]
145146
config_dir=/etc

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ private function _setup_ssh_rsa() {
489489
if (!file_exists($sshkeys)){
490490
// add root's key
491491
$app->file->mkdirs($sshdir, '0755');
492-
if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys'));
492+
$authorized_keys_template = $this->jailkit_config['jailkit_chroot_authorized_keys_template'];
493+
if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents($authorized_keys_template));
493494

494495
// Remove duplicate keys
495496
$existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);

0 commit comments

Comments
 (0)