'', 'ssh_public_key' => '' ]; $sshStrength = Config::getInstance()->get('php-censor.ssh.strength', 2048); $sshComment = Config::getInstance()->get('php-censor.ssh.comment', 'admin@php-censor'); $output = @shell_exec( sprintf( 'ssh-keygen -t rsa -b %s -f %s -N "" -C "%s"', $sshStrength, $keyFile, $sshComment ) ); if (!empty($output)) { $pub = file_get_contents($keyFile . '.pub'); $prv = file_get_contents($keyFile); if (!empty($pub)) { $return['ssh_public_key'] = $pub; } if (!empty($prv)) { $return['ssh_private_key'] = $prv; } } return $return; } }