加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – ssh tunnel – bind:无法分配请求的地址

发布时间:2020-12-13 18:34:34 所属栏目:Linux 来源:网络整理
导读:尝试创建一个socks(-D)ssh隧道 – Linux盒子到 Linux盒子(两个centos): sshd在远程端运行ok. 从本地机器我们做/看到这个: ssh -D 1080 user@8.8.8.8.user@8.8.8.8's password: bind: Cannot assign requested address (其中8.8.8.8实际上是我服务器的IP,’
尝试创建一个socks(-D)ssh隧道 – Linux盒子到 Linux盒子(两个centos):

sshd在远程端运行ok.

从本地机器我们做/看到这个:

ssh -D 1080 user@8.8.8.8.
user@8.8.8.8's password: 
bind: Cannot assign requested address

(其中8.8.8.8实际上是我服务器的IP,’用户’是我的真实用户名)

我在这个终端窗口登录到远程端.我可以在此命令之前验证本地端口是否未使用,然后在命令之后由ssh进程使用,通过:

netstat -lnp | grep 1080

因此,与大多数带有此错误的googled-response不同,问题似乎不是环回接口分配.如果我尝试将此隧道与邮件客户端一起使用,则本地端允许尝试(没有“代理失败”错误),但不返回任何数据/回复.

在远程端,我的sshd_config中确实有“PermitTunnel yes”(尽管“是”应该是默认值,无论如何).

想法还是线索?

这是相关的调试输出

OpenSSH_5.3p1,OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *

....

debug1: Authentication succeeded (password).
debug1: Local connections to LOCALHOST:1080 forwarded to remote address socks:0
debug1: Local forwarding listening on 127.0.0.1 port 1080.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on ::1 port 1080.
bind: Cannot assign requested address
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.utf8

其他线索:如果我在运行Windows的客户端上运行虚拟盒,则在该框中打开一个带有putty的隧道,该隧道可以在同一个远程服务器上运行.

Stranger仍然“如果我使用Putty(用于Linux)直接在Linux客户端上运行,它就不起作用,即使这些设置完全重复了Putty设置,这些设置在Windows上的虚拟盒中运行的Putty中工作客户端机器?有些东西可疑…仍在尝试实验来弄清楚它是什么.

解决方法

这里关闭循环.在这种情况下,答案是强制ssh客户端使用ipv4.例如.
ssh -4 -D 8081 user@8.8.8.8

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读