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

Bash:连接到Linux抽象UNIX套接字

发布时间:2020-12-15 21:22:25 所属栏目:安全 来源:网络整理
导读:我有 abstract Linux socket 听取连接. 抽象的Linux套接字基本上是一个名为AF_UNIX的套接字 – 除了名称不引用文件系统上的文件.相反,名称只是位于内核中抽象套接字命名空间内的唯一名称. 我的问题:有没有办法只使用Bash shell连接到抽象套接字?我从this q
我有 abstract Linux socket听取连接.

抽象的Linux套接字基本上是一个名为AF_UNIX的套接字 – 除了名称不引用文件系统上的文件.相反,名称只是位于内核中抽象套接字命名空间内的唯一名称.

我的问题:有没有办法只使用Bash shell连接到抽象套接字?我从this question开始就知道你可以使用socat或netcat连接到与文件系统上的文件相关联的普通命名的AF_UNIX套接字.但是当我尝试使用抽象套接字时,它不起作用(它将我的名字字符串视为文件,并报告“找不到文件”,这是我的预期.)

那么,我可以使用任何实用程序连接到抽象的Linux套接字吗?

解决方法

现代版本的socat为此提供了一个ABSTRACT命名空间.

引自the manual:

ABSTRACT-CONNECT:<string>

ABSTRACT-LISTEN:<string>

ABSTRACT-SENDTO:<string>

ABSTRACT-RECVFROM:<string>

ABSTRACT-RECV:<string>

ABSTRACT-CLIENT:<string>

The ABSTRACT addresses are almost identical to the related UNIX addresses except that they do not address file system based sockets but an alternate UNIX domain address space. To archieve this the socket address strings are prefixed with “” internally. This feature is available (only?) on Linux. Option groups are the same as with the related UNIX addresses,except that the ABSTRACT addresses are not member of the NAMED group.

(编辑:李大同)

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

    推荐文章
      热点阅读