setup proxy for ssh connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 添加到 ~/.ssh/config | |
# 修改 <custom-name> 为任意名字 | |
# 修改 <ip> 为服务器地址 | |
# 修改 <username> 为登录服务器的用户名 | |
# 修改 <port> 为服务器端口 | |
# 修改完 ssh custom-name 就可以登录服务器了 | |
# 下面的配置是仅 Mac 有效的 | |
Host <custom-name> | |
User <username> | |
HostName <ip> | |
ServerAliveInterval 30 | |
ServerAliveCountMax 600 | |
ProxyCommand /usr/bin/nc -x 127.0.0.1:<port> %h | |
# 如果你是 linux | |
# ProxyCommand 一行需要改动为如下: | |
Host <custom-name> | |
User <username> | |
HostName <ip> | |
ServerAliveInterval 30 | |
ServerAliveCountMax 600 | |
ProxyCommand /bin/nc -x 127.0.0.1:<port> %h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment