如果我做
macos - ssh server1 -A
server1 - sudo -HE ssh root@server2 -w 0:0
一切正常
tun 设备成功
ifconfig -a
#contain
tun0: flags=4240<POINTOPOINT,NOARP,MULTICAST> mtu 1500
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但如果我尝试从 macos (10.15.7 (19H15)) 执行此操作
sudo ssh root@server2 -w 0:0
Tunnel device open failed.
Could not request tunnel forwarding.
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-42-generic x86_64)
with -vvv
debug1: sys_tun_open: /dev/tun0 open failed: No such file or directory
Tunnel device open failed.
Could not request tunnel forwarding.
失败了(
请告诉我怎么了?
- - - 更新 - - - -
现在一切都很悲伤,mac os 不包含 Tun Tap 软件,找到了 tuntaposx 项目但它不起作用,苹果“重制”KPI(内核编程接口)https://developer.apple.com/support/kernel-extensions/
我还没有找到替代方案。
目前尚不清楚这有多现实 - 如果 ssh 依赖于 tun / tap 适配器的文件、对象
答案1
server2
通过编辑配置文件启用隧道/etc/ssh/sshd_config
放PermitTunnel yes
然后重新启动 SSH 守护进程