Friday, May 2, 2025

Update Unauthorized, after latest update in Promox PMG

Just fyi in case somebody else gets stuck. I ended up having to edit 2 files.
#1 is /etc/apt/sources.list.d . On there I had the enterprise.proxmox.com line with pve-enterprise at the end. I commented that out.

#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise

#2 was editing the /etc/apt/sources.list file. On there I added the line with the download.proxmox.com (pve-no-subscription) as the Package_Repositories page suggests.

deb http://ftp.us.debian.org/debian bullseye main contrib

deb http://ftp.us.debian.org/debian bullseye-updates main contrib

[Read more...]

Wednesday, October 23, 2024

How to upgrade mariadb on cyberpanel from 10.3 to 10.6 on ubuntu 20.04

In this guide, we shall indicate two methods of upgrading a database

Method 1: Automated upgrade script. The script will handle everything for you including backups.

Using the convenience script.

wget -qO- https://raw.githubusercontent.com/dannydev77/database_upgrade_utility_script/main/database_upgrade.sh | bash

Method 2: Manual – This section provide step by step actions.

Before you begin the upgrade ensure to take a backup of your data in case something goes wrong.

Steps:
[Read more…]

Saturday, September 21, 2024

Disable 2FA In CyberPanel

For those who have been locked out Cyberpanel due to two factor aunthentication, I have tried all methods on this forum but none worked for me when i lost my Google aunthenticator app. I hope my method works for you. Don’t get locked out of your server. Cheers!

1. Firstly, try connecting through SSH and entering the MySQL command line with these commands.

MYSQL_PWD=`cat /etc/cyberpanel/mysqlPassword` mysql -uroot

2. In order to enter the CyberPanel database, use the command:

use cyberpanel;

3. Now disable 2FA for the admin account with the following command:

UPDATE `loginSystem_administrator` SET `twoFA` = '0' WHERE `loginSystem_administrator`.`id` = 1;

[Read more…]

Sunday, September 8, 2024

Block Direct Access to IP in Nginx (Zimbra Proxy)

Zimbra uses Nginx as its proxy, and you can configure Nginx to block direct access via the server’s IP address. Here’s how to configure it:
Edit Nginx Configuration for Web Access:

sudo nano /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.default

Add Server Block to Deny IP-Based Access: Add a new server block at the top of the configuration to deny access via the server’s IP.

server {
    listen 80;
    listen 443 ssl;
    server_name <em>;  # This matches any request not using a domain name (IP-based access)
    return 444;     # Return a 444 response (which drops the connection without sending a response)
}

[Read more…]

Saturday, September 7, 2024

PHP Ban IP to Cloudflare API Script

Usage:
Run the script periodically using a cron job (Linux) or Task Scheduler (Windows) to handle blocking and removal of expired blocks.

Ensure paths to logs and other configurations are updated to reflect your actual setup.

<?php
// Cloudflare API settings
$apiKey = "your_cloudflare_api_key"; // Global API Key
$authEmail = "your_cloudflare_email"; // Cloudflare account email
$zoneID = "your_zone_id"; // Zone ID
$logPath = "C:pathtoaccess.log"; // Path to Apache access log
$blockLogPath = "C:pathtoblock.log"; // Path to log block actions
$blockRemoveLogPath = "C:pathtoblock_remove.log"; // Path to log block removal actions
$threshold = 10; // Number of 404s to trigger a block
$timeWindowMinutes = 10; // Time window in minutes for analysis
$blockDurationHours = 1; // Duration to block IP in hours

// Current timestamp minus time window (in seconds)
$timeWindow = time() - ($timeWindowMinutes * 60);

// Function to log messages to a file
function logMessage($message, $logFilePath) {
    $timestamp = date('Y-m-d H:i:s');
    file_put_contents($logFilePath, "[$timestamp] $message" . PHP_EOL, FILE_APPEND);
}
[Read more...]

Monday, September 2, 2024

ກຳນົດ actionban ແລະ actionunban ໃຫ້ກັບ Fail2ban ຕໍ່ກັບ Cloudflare API

Modify the Fail2ban Action:

[Definition]
actionban = curl -s -X POST "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/firewall/access_rules/rules" 
-H "X-Auth-Email: [email protected]" 
-H "X-Auth-Key: your-global-api-key" 
-H "Content-Type: application/json" 
--data '{"mode":"block","configuration":{"target":"ip","value":"<ip>"},"notes":"Fail2ban block"}'

Fail2ban actionunban

[Definition]
actionunban = bash -c '
RULE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/firewall/access_rules/rules" 
-H "X-Auth-Email: [email protected]" 
-H "X-Auth-Key: your-global-api-key" 
-H "Content-Type: application/json" | jq -r ".result[] | select(.configuration.value == "<ip>") | .id") && 
curl -s -X DELETE "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/firewall/access_rules/rules/$RULE_ID" 
-H "X-Auth-Email: [email protected]" 
-H "X-Auth-Key: your-global-api-key" 
-H "Content-Type: application/json"'

[Read more…]

Friday, August 23, 2024

Change the listening port for Remote Desktop on your computer

When you connect to a computer (either a Windows client or Windows Server) through the Remote Desktop client, the Remote Desktop feature on your computer “hears” the connection request through a defined listening port (3389 by default). You can change that listening port on Windows computers by modifying the registry.

1. Start the registry editor. (Type regedit in the Search box.)
2. Navigate to the following registry subkey: HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp
3. Find PortNumber
4. Click Edit > Modify, and then click Decimal.
5. Type the new port number, and then click OK.
6. Close the registry editor, and restart your computer.

The next time you connect to this computer by using the Remote Desktop connection, you must type the new port. If you’re using a firewall, make sure to configure your firewall to permit connections to the new port number.

[Read more…]

Subscribe

  • RSS Atom

ອອນລາຍ: 2 | ມື້ນີ້: 10 | ວານນີ້: 25 | ທິດນີ້: 90 | ເດືອນນີ້: 869 | ປີນີ້: 11829 | ລວມ: 78932