#!/usr/local/cpanel/3rdparty/bin/perl # gniza4cp WHM Plugin — Setup Wizard # Step 1: SSH Key selection, then redirects to remotes.cgi and schedules.cgi use strict; use warnings; use lib '/usr/local/cpanel/whostmgr/docroot/cgi/gniza4cp-whm/lib'; use Whostmgr::HTMLInterface (); use Cpanel::Form (); use Gniza4cpWHM::UI; my $form = Cpanel::Form::parseform(); handle_step1(); exit; # ── Step 1: SSH Key ────────────────────────────────────────── sub handle_step1 { print "Content-Type: text/html\r\n\r\n"; Whostmgr::HTMLInterface::defheader('gniza4cp Setup Wizard', '', '/cgi/gniza4cp-whm/setup.cgi'); print Gniza4cpWHM::UI::page_header('gniza4cp Setup Wizard'); my $keys = Gniza4cpWHM::UI::detect_ssh_keys(); print qq{
gniza4cp uses SSH keys to connect to remote backup destinations. Select an existing key or create one first.
\n}; if (@$keys) { print qq{Existing keys found:
\n}; print qq{| Type | Path | Public Key | |
|---|---|---|---|
| }; print qq{ | $esc_type | }; print qq{$esc_path | };
print qq{$pub | }; print qq{
/root/.ssh/. You need to create one first.Generate a new SSH key (if needed):
\n}; print qq{ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N ""\n}; print qq{
Copy the public key to the remote server:
\n}; print qq{ssh-copy-id -i /root/.ssh/id_ed25519.pub user\@host\n}; print qq{
Run these commands in WHM → Server Configuration → Terminal, or via SSH.
\n}; print qq{