BER分博客 - 环境配置 https://blog.berfen.com/category/environment/ zh-CN Fri, 17 Jul 2026 03:55:36 +0000 Fri, 17 Jul 2026 03:55:36 +0000 虚拟机没有 IP 时,如何通过 SSH 隧道进入 KVM 控制台 https://blog.berfen.com/post/65.html https://blog.berfen.com/post/65.html Fri, 17 Jul 2026 03:55:36 +0000 taotecode 虚拟机没有 IP 时,如何通过 SSH 隧道进入 KVM 控制台

一台 KVM 虚拟机无法通过 SSH 连接,不一定意味着它已经失去控制。虚拟机可能尚未获取 DHCP 地址、静态网络配置错误、系统停在磁盘解密界面,甚至根本还没有启动到网络服务。

[...]

]]>
0 https://blog.berfen.com/post/65.html#comments
CentOS 7.9 修复 VS Code Remote-SSH:用私有 glibc 2.28 绕过 glibc 2.17 限制 https://blog.berfen.com/post/64.html https://blog.berfen.com/post/64.html Wed, 15 Jul 2026 02:24:33 +0000 taotecode 从 VS Code 1.99 开始,Remote - SSH 下载的新版 VS Code Server 要求 glibc 2.28 或更高版本。CentOS 7.9 自带的 glibc 长期停留在 2.17,因此会出现“普通 SSH 可以登录,但 VS Code 无法完成远程连接”的情况。

本文使用开源项目 hsfzxjy/vscode-remote-glibc-patch 提供的预编译 sysroot,为 VS Code Server 单独准备 glibc 2.28、动态链接器和 patchelf。整个过程不会替换 CentOS 的系统 glibc,已经在一台 CentOS 7.9 x86_64 服务器上验证可用。

[...]

]]>
0 https://blog.berfen.com/post/64.html#comments
从 macOS 钥匙串弹窗到 GitLab SSH:一次自建 GitLab 访问方式优化实践 https://blog.berfen.com/post/62.html https://blog.berfen.com/post/62.html Sat, 13 Jun 2026 07:38:11 +0000 taotecode 一、问题背景

某些项目在 macOS 上通过 IDE 打开时,会不断弹出类似下面的系统授权窗口:

git-credential-osxkeychain wants to use your confidential information stored in "gitlab.example.internal" in your keychain.

这类弹窗通常不是 GitLab 服务端异常,而是本机 Git 在访问 HTTPS remote 时,调用 macOS Keychain 凭据助手读取用户名、密码或 token。

[...]

]]>
0 https://blog.berfen.com/post/62.html#comments
Ubuntu Server 24.x 在 VMware ESXi 中安装为仅 root 用户的完整指南 https://blog.berfen.com/post/61.html https://blog.berfen.com/post/61.html Thu, 28 May 2026 09:09:46 +0000 taotecode 前言

在服务器场景中,有些虚拟机只用于单一服务、实验环境、GPU/AI 计算节点或内网运维节点,并不需要普通桌面用户目录,也不希望系统自动创建 /home 等额外分区。

Ubuntu Server 24.x 的安装器基于 Subiquity,默认安装流程会要求创建一个普通用户,并且默认磁盘布局可能会使用 LVM。这对很多通用场景是合理的,但如果目标是一个简洁的服务器系统,常见需求会变成:

  • 只保留 root 用户;
  • 不创建独立 /home 分区;
  • 不使用 LVM;
  • 磁盘只保留 EFI 分区和根分区 /;
  • 安装完成后允许 root 通过 SSH 密码登录。

本文记录一套适用于 Ubuntu Server 24.x live-server 系列镜像 的完整安装流程,例如:

  • ubuntu-24.04-live-server-amd64.iso
  • ubuntu-24.04.1-live-server-amd64.iso
  • ubuntu-24.04.2-live-server-amd64.iso
  • ubuntu-24.04.3-live-server-amd64.iso
  • ubuntu-24.04.4-live-server-amd64.iso
  • 后续 Ubuntu 24.04 LTS 同系列 live-server 镜像

本文以 VMware ESXi 虚拟机为例,但安装器内的步骤同样适用于大多数虚拟化平台。

[...]

]]>
0 https://blog.berfen.com/post/61.html#comments
彻底解决 macOS "git-credential-osxkeychain 想要访问钥匙串" 弹窗问题 https://blog.berfen.com/post/60.html https://blog.berfen.com/post/60.html Fri, 13 Feb 2026 10:22:00 +0000 taotecode 问题现象

在 macOS 系统中使用 Git 时,经常会遇到一个令人困扰的弹窗:

"git-credential-osxkeychain" 想要访问你的钥匙串中的密钥 "gitlab.xxx.cloud"

更糟糕的是,当你打开"钥匙串访问"应用尝试删除这个凭证时,却发现:

  • 找不到对应的条目
  • 或者删除后弹窗依然出现
  • 甚至删除按钮是灰色的,无法操作

这个问题的根本原因是 Git 凭证存储在 macOS 钥匙串中,但权限配置出现了异常,导致 git-credential-osxkeychain 工具无法正常访问凭证。

[...]

]]>
0 https://blog.berfen.com/post/60.html#comments
Linux服务管理完全指南:systemctl命令详解 https://blog.berfen.com/post/51.html https://blog.berfen.com/post/51.html Wed, 20 Aug 2025 09:49:33 +0000 taotecode 在采用systemd作为初始化系统的现代Linux发行版(如Ubuntu 16.04+/Debian 8+/CentOS 7+/RHEL 7+等)中,systemctl已成为管理系统服务的核心工具。以下是操作详解:

[...]

]]>
0 https://blog.berfen.com/post/51.html#comments
使用Nginx反向代理华为云OBS的实践与问题解决方案 https://blog.berfen.com/post/48.html https://blog.berfen.com/post/48.html Tue, 29 Apr 2025 03:12:00 +0000 taotecode 引言

在云原生架构中,通过Nginx反向代理访问对象存储服务(如华为云OBS)是常见的优化方案,可实现流量转发、权限控制或域名绑定。然而,实际配置中常因请求头、路径或签名计算问题导致SignatureDoesNotMatch或Your Objectkey is invalid等错误。本文基于真实案例,系统性总结问题根源与解决方案。

[...]

]]>
0 https://blog.berfen.com/post/48.html#comments
Nginx日志配置优化与安全增强实践 https://blog.berfen.com/post/47.html https://blog.berfen.com/post/47.html Tue, 29 Apr 2025 03:07:46 +0000 taotecode 引言

Nginx作为高性能Web服务器,其日志系统是运维监控的核心组件。本文基于真实优化案例,系统讲解如何通过精细化日志配置实现**性能提升30%**的同时,增强安全审计能力。结合生产环境验证数据,展示日志字段选择对运维效率的直接影响。

[...]

]]>
0 https://blog.berfen.com/post/47.html#comments
macOS下Nginx绑定80端口的终极解决方案:端口转发与权限管理实践 https://blog.berfen.com/post/46.html https://blog.berfen.com/post/46.html Tue, 29 Apr 2025 03:04:14 +0000 taotecode 一、问题背景

在macOS系统中部署Nginx时,开发者常遇到两个核心问题:

  1. 权限警告:使用sudo brew services restart nginx时出现路径所有权警告(如Taking root:admin ownership)。
  2. 端口限制:非root用户无法绑定1024以下特权端口(如80端口)。

本文将系统性解决这些问题,并提供可复用的配置方案。

[...]

]]>
0 https://blog.berfen.com/post/46.html#comments
跨服务器安全访问:基于Nginx反向代理与端口转发的实践指南 https://blog.berfen.com/post/45.html https://blog.berfen.com/post/45.html Tue, 29 Apr 2025 03:00:14 +0000 taotecode 引言

在多服务器架构中,网络隔离与访问控制是保障安全的重要手段。本文将基于实际场景,探讨如何在仅允许特定端口通信的限制下,通过Nginx反向代理与端口转发技术,实现从隔离服务器(服务器B)安全访问外网服务(如Git、OSS)的完整方案。

[...]

]]>
0 https://blog.berfen.com/post/45.html#comments