LoginSignup
0
0

How to establish an SSH connection via a proxy / 在 SSH 中使用 Socks 代理连接远程服务器

Last updated at Posted at 2023-08-30

转载自 https://www.cnblogs.com/liuxianshen/p/use-socks-proxy-connect-remote-server-in-ssh.html

  • 直接敲命令

ssh -p 2022 -o ProxyCommand='ncat --proxy-type socks5 --proxy 127.0.0.1:7890 %h %p --proxy-auth test:123456' test2@192.168.0.233

  • ~/.ssh/config中添加配置
Host loli
  HostName 192.168.0.233
  Port 2022
  User test2
  IdentityFile ~/.ssh/id_rsa
  ProxyCommand ncat --proxy-type socks5 --proxy 127.0.0.1:7890 %h %p --proxy-auth test:123456

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0