Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Category: Linux

About Linux Tech

Ubuntu Server: Install Desktop + XRDP (Fix IPv4, NAT, and “Something Has Gone Wrong” Error)

Posted on 2025-11-132025-11-13 by Rico

This guide provides a full step-by-step setup for XRDP on Ubuntu Server, covering: 1. Install Desktop Environment (XFCE) Option A — Xubuntu Desktop (full) Option B — Minimal XFCE (recommended) 2. Install XRDP Add SSL permissions: 3. Force XRDP to Listen on IPv4 Edit: Change: to: Restart: Verify IPv4 listener: Expect: 4. Fix NAT Connectivity…

Read more

Ubuntu Server 安裝 Desktop + XRDP(完整流程:桌面、RDP、IPv4、NAT、XFCE 修正)

Posted on 2025-11-132025-11-13 by Rico

本文介紹如何在 Ubuntu Server 安裝桌面環境與 XRDP,並解決以下常見問題: 本篇提供完整、可直接使用的解決方案。 1. 安裝 Desktop(XFCE)與 XRDP 建議使用 XFCE——輕量、穩定、最適合 Server 遠端桌面。 (1)安裝桌面環境 選擇 A / B 其中一個即可。 A. 安裝完整 Xubuntu Desktop(比較完整) B. 安裝純 XFCE(更輕量,建議) (2)安裝 XRDP 加入 SSL 群組(避免證書存取權限問題): 2. 修正 XRDP 啟動 IPv4(預設只開 IPv6) Ubuntu 22.04 / 24.04 預設 xrdp 會 只監聽 IPv6 (::) → 造成外網或 NAT 無法連線。 編輯: 找到原本的: 改成:…

Read more

Ubuntu — Disable IPv6 and Force APT to Use IPv4

Posted on 2025-11-102025-11-10 by Rico

(For Ubuntu 22.04 / 24.04 / 24.10 / 24.04 LTS “Noble”) In many enterprise or internal environments, IPv6 is not yet supported.This often causes apt to fail when trying to download packages, showing messages like: This means Ubuntu tried to connect over IPv6, but the network doesn’t support it. 🔍 Problem Description By default, Ubuntu:…

Read more

Ubuntu 關閉 IPv6 與強制 apt 使用 IPv4 的完整指南

Posted on 2025-11-102025-11-10 by Rico

(適用 Ubuntu 22.04 / 24.04 / 24.10 / 24.04 LTS “Noble”) 在企業或內部環境中,許多網路尚未支援 IPv6,導致 Ubuntu 系統在安裝套件時出現連線錯誤。例如以下訊息: 這表示 apt 嘗試透過 IPv6 連線,但 IPv6 網路不可達,導致安裝或更新中斷。 🔍 問題說明 Ubuntu 預設會: 當伺服器、網關或防火牆未支援 IPv6 時,就會出現「Network is unreachable」或「Connection timed out」的錯誤。 🧰 解決步驟 步驟 1:永久關閉 IPv6 編輯設定檔: 在最後加入以下內容: 套用設定: 確認是否關閉: 若輸出為 1,表示 IPv6 已停用。 步驟 2:強制 apt 使用 IPv4 建立設定檔: 內容輸入: 儲存後執行: 此時…

Read more

Replacing AD with Samba: Can OpenLDAP Be the Backend? Practical Feasibility, Options & Migration Guide

Posted on 2025-11-062025-11-06 by Rico

Your Context Key Fact: Samba AD DC vs. OpenLDAP Do You Really Need a Domain? You can avoid it—but know the trade-offs Running without a domain still works for SMB and RDS, but you’ll face: Minimal domain (Samba AD) advantages—even with no GPOs: Three Architecture Options A. Samba AD DC replaces AD (recommended, pragmatic) B….

Read more

How Docker Containers Communicate Using Container Names

Posted on 2025-11-06 by Rico

When running multiple Docker containers, one common question is:“Can containers connect to each other using their container names?”The answer is Yes!But — only if they are on the same custom Docker network. 1. Why the Default Network Doesn’t Work By default, Docker creates a bridge network (also known as docker0).However, this default bridge network does…

Read more

Docker 不同容器間如何透過容器名互相連線

Posted on 2025-11-062025-11-06 by Rico

在使用 Docker 建立多個服務容器時,常常會遇到一個問題:「不同容器之間能不能用容器名稱互相連線?」答案是 —— 可以的!但前提是:它們必須在同一個自訂的 Docker network 裡。 一、為什麼預設 network 不行? Docker 預設會建立一個名為 bridge 的網路(也就是 docker0)。這個預設網路不提供容器名的 DNS 解析,因此容器之間只能用 IP 位址互相連線。 這樣做在測試階段還可以,但在實際環境中,容器 IP 經常變動,維護起來相當麻煩。 二、建立自訂 network 要讓容器之間能用「容器名稱」互相連線,最簡單的方法就是建立一個自訂的 network。 建立好之後,所有加入這個 network 的容器,就能彼此透過名稱解析進行通訊。 三、讓容器加入同一個 network 啟動容器時指定 network 參數: 此時,web 與 app 這兩個容器都在 mynet 網路裡。 四、容器之間用名稱連線 進入其中一個容器(例如 app): 測試連線: Docker 的內建 DNS 會自動解析 web → web 容器的 IP。因此你不需要知道 IP…

Read more

Fixing Fail2Ban Postfix Filter Errors on CentOS 7

Posted on 2025-11-062025-11-06 by Rico

1. Background When managing mail servers, Fail2Ban is used to block malicious IPs and brute-force attempts.On CentOS 7 (Fail2Ban v0.11.2 / Python 2.7), running: triggered the following error: 2. Root Cause Fail2Ban filters often reference shared variables like: These are defined in /etc/fail2ban/filter.d/common.conf.However, on older versions (e.g., CentOS 7’s 0.11.x), the IPv4/IPv6 variables are missing,causing…

Read more

在 CentOS 7 修正 Fail2Ban Postfix 過濾器錯誤並建立有效防護

Posted on 2025-11-062025-11-06 by Rico

一、問題背景 在管理郵件伺服器時,Fail2Ban 常用於封鎖惡意連線或暴力破解行為。Rico 在 CentOS 7(Fail2Ban v0.11.2 / Python 2.7)環境下執行以下指令測試 Postfix 過濾器: 卻出現錯誤訊息: 二、問題原因 Fail2Ban 的過濾器(filter)會引用一些共用變數,如: 這些變數定義在 /etc/fail2ban/filter.d/common.conf。但在某些舊版(如 0.11.x for CentOS 7)中,__prefix_ipv4 和 __prefix_ipv6 並未被定義,導致過濾器解析失敗。 三、修正方法 ✅ 方法一:改用 <HOST>(推薦) Fail2Ban 內建 <HOST> 巨集,自動辨識 IPv4 與 IPv6。修改 /etc/fail2ban/filter.d/postfix-pipelining.conf: 測試: 若輸出顯示: 即代表成功命中。 ✅ 方法二:手動補上變數(若不想改 regex) 在 filter 開頭自行定義: 四、延伸:建立 Postfix 過濾器防護 建立 jail 設定 /etc/fail2ban/jail.d/postfix-pipelining.local: 重新載入: 五、進階:擴充另一個過濾器…

Read more

Testing SMTP with PHP (PHP 7.4 Example)

Posted on 2025-11-062025-11-06 by Rico

When setting up a mail server (like Postfix + Dovecot) or debugging email delivery, it’s often necessary to verify whether your SMTP host works correctly and if your credentials are valid.Here are two practical methods you can use with PHP 7.4. ✅ Method 1: Using PHPMailer (Recommended) PHPMailer is a full-featured mailer library supporting STARTTLS…

Read more

Posts pagination

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme