2025-12-08
SSH转发让A server使用B server的代理
2025-12-08 ~ 2025-12-08

The note is generated by “chatGPT”.

当希望 A 服务器借用 B 服务器的代理网络(例如 Clash/Mihomo 的 7890 端口)时,可以使用 SSH 的端口转发(ssh -L)来实现。
最终效果是:

A 访问 127.0.0.1:本地端口  → 通过 SSH 转发到 B:7890 → B 的 Clash 提供代理功能

1️⃣ 前提条件

  • A 可以 SSH 登录 B

2025-11-07
SSH自动登录与debug
2025-11-07 ~ 2025-11-07

The note is generated by “DeepSeek”.

一、基础设置步骤

1. 生成 SSH 密钥对(客户端)

1
2
ssh-keygen -t rsa -b 4096
# 默认保存位置:~/.ssh/id_rsa (私钥) 和 ~/.ssh/id_rsa.pub (公钥)

2. 复制公钥到服务器

方法一:使用 ssh-copy-id(推荐)

2025-10-24
Proxy set, but ssh -T git@github.com fails
2025-10-24 ~ 2026-10-15

The note is generated by ChatGPT.

Observation — Proxy set, but SSH still fails

Although you set http_proxy / https_proxy (or all_proxy), running:

1
ssh -T git@github.com

still times out or fails.

Root cause — SSH does NOT use the HTTP proxy (key point)

Terminal HTTP/SOCKS environment variables affect HTTP/HTTPS-aware programs (curl, wget, git clone https://…, etc.), but OpenSSH does not honor those variables. SSH opens a raw TCP connection and must be explicitly told to use a proxy — otherwise it tries a direct connection and gets blocked by the network/firewall.

2025-10-17
Git配置SSH Key
2025-10-17 ~ 2025-10-17

The note is generated by 豆包.

一、配置目的

通过 SSH Key 实现与远程仓库(GitHub/GitLab/Gitee 等)的无密码安全连接,避免每次操作远程仓库时重复输入账号密码。

二、操作步骤

1. 检查本地是否已存在 SSH Key

首先确认本地是否已有生成好的 SSH Key,避免重复创建。