πŸ” Using VLESS proxy with SSH

In this short note, we will explore the process of using a VLESS proxy with SSH. It can be useful for situations when destination host is blocked for some reason.

How to proxify SSH

Shortly, assuming a VLESS proxy is running at localhost:10808, that’s what you need to put into ~/.ssh/config:

Host github.com
 User git
 Hostname github.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/id_github.pub
 ProxyCommand socat - PROXY:localhost:%h:%p,proxyport=10808

Some additional points to check:

  • Ensure that socat is installed.
  • Replace Host, Hostname, User with the corresponding values, if needed.
  • If you’re using WSL, ensure that proxy is accessible from inside. Probably you would need to refer to it using host interface address instead of localhost (see ip a).
  • To check your IP address and ensure that traffic goes through proxy, you can use curl ifconfig.me/ip (which must respond with your direct IP address) and curl -x "socks5://localhost:10808" ifconfig.me/ip (which must respond with proxified IP).