Use SSH Tunnel to Secure Traffic

该博客介绍了如何通过SSH命令设置SOCKS隧道,详细解释了参数的意义,如-i指定SSH密钥,-D设置SOCKS端口,-f后台运行,-C数据压缩,-q静默模式,-N不执行远程命令。还提供了一个客户端脚本示例,用于启动Firefox浏览器利用SOCKS隧道。SOCKS工作在OSI模型的第五层,通常在TCP端口1080上监听客户端连接。
摘要由CSDN通过智能技术生成
Set up the tunnel with this command:
ssh -i ~/.ssh/id_rsa -D 2345 -f -C -q -N ja@peerend

Explanation of arguments:

-i: The path to the SSH key to be used to connect to the host
-D: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025 and 65536)
-f: Forks the process to the background
-C: Compresses the data before sending it
-q: Uses quiet mode
-N: Tells SSH that no command will be sent once the tunnel is up
Client script

socks.sh

#!/bin/bash -e
ssh -i ~/.ssh/id_rsa -D 2345 -f -C -q -N ja@peerend
/usr/bin/firefox &

SOCKS performs at Layer 5 of the OSI model. A SOCKS server accepts incoming client connection on TCP port 1080.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值