ssh beyond a proxy server

It can be achived by defining the ProxyCommand in the ~/.ssh/config file. For example,

Host ip
  HostName ip
  Port 22
  ProxyCommand nc -x 127.0.0.1:7890 -X 5 %h %p

nc: the command to use, understand it by nc —help .

127.0.0.1:7890: proxy address and port.

-X 5: specify the proxy version to socks5