| Server IP : 104.21.93.65 / Your IP : 104.23.197.33 Web Server : Apache System : Linux server.localhost.com 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 User : pahana ( 1029) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/usermin/ssh/ |
Upload File : |
#!/usr/bin/perl
# Show details of one key
require './ssh-lib.pl';
&ReadParse();
@keys = &list_ssh_keys();
($key) = grep { $_->{'private_file'} eq $in{'file'} } @keys;
$key || &error($text{'ekey_egone'});
&ui_print_header(undef, $text{'ekey_title'}, "");
print &ui_form_start("save_key.cgi", "form-data");
print &ui_hidden("file", $in{'file'});
print &ui_table_start($text{'ekey_header'}, undef, 2);
# Private key
if ($key->{'type'} eq 'rsa1') {
# Old format is binary .. offer to download and upload
$short = $key->{'private_file'};
$short =~ s/^.*\///;
print &ui_table_row($text{'ekey_private1'},
"<a href='download_key.cgi/$short?file=".
&urlize($key->{'private_file'})."'>$text{'ekey_down'}</a>");
print &ui_table_row($text{'ekey_private2'},
&ui_upload("private"));
}
else {
# New format is test
print &ui_table_row($text{'ekey_private'},
&ui_textarea("private",
&read_file_contents($key->{'private_file'}),
10, 80));
}
# Public key
print &ui_table_row($text{'ekey_public'},
&ui_textarea("public", &read_file_contents($key->{'public_file'}),
10, 80, undef, 0, "readonly=true"));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'ekey_save'} ] ]);
&ui_print_footer("list_keys.cgi", $text{'lkeys_return'});