SSH 配置

本文最后更新于:2024年3月18日 凌晨

SSH 配置

代理配置

  • ~/.ssh/config
1
2
3
4
5
6
7
Host github.com
HostName github.com
User git
# 走 HTTP 代理。
# ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=8080
# 走 socks5 代理(如 Shadowsocks)
ProxyCommand nc -v -x 127.0.0.1:1080 %h %p
  • Host:表示主机,可直接用ssh <Host>连接配置好的主机。
  • HostName:主机名,可以使用域名或者IP地址。
  • User:ssh连接的用户名。
  • Port:端口号,默认22
  • ForwardAgent:是否将连接的主机作为本机的代理。
  • ProxyCommand:代理配置。

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!