Prerequisites

I’m using ClashX for Mac here. If you’re interested in SSH acceleration, you likely already have a Socks5 proxy service or something similar.

Modifying the Configuration File

vim ~/.ssh/config

Replace REMOTE_SERVER_NAME, REMOTE_SERVER_IP, and 127.0.0.1:7890 in the content below with your corresponding server information. It’s recommended to use Socks5 for proxying.

Host REMOTE_SERVER_NAME
	User root
	HostName REMOTE_SERVER_IP
	Port 22
	IdentityFile ~/.ssh/id_rsa
	ProxyCommand nc -x 127.0.0.1:7890 -X 5 %h %p

After completing the configuration above, you can use ssh REMOTE_SERVER_NAME in the command line to access overseas servers through the Socks5 proxy. If you’re not sure whether it’s going through the proxy, you can open the ClashX Dashboard to check if there’s a corresponding connection.

ClashX Dashboard

Say goodbye to command line lag!

I hope this is helpful, Happy hacking…