Forward abstract unix socket over SSH?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















I've discovered that OpenSSH is capable of forwarding UNIX sockets like this:



ssh -R /var/run/program.sock:/var/run/program.sock


My question is whether this extends to abstract unix sockets too.



I've tried the following to no avail:



ssh -nNT -R @laminar:@laminar
ssh -nNT -R unix-abstract:laminar:unix-abstract:laminar


The program in question does support file-based unix sockets, but as it uses abstract sockets by default I'd like to avoid reconfiguring it to simplify matters if possible.



  • OpenSSH (client) version: OpenSSH_7.4p1 Raspbian-10+deb9u4, OpenSSL 1.0.2q 20 Nov 2018

  • OpenSSH (server) version: OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017









share|improve this question



















  • 1





    socat supports abstract sockets. Perhaps you could use it as an intermediate.

    – meuh
    Feb 5 at 14:43






  • 1





    Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

    – Patrick Mevzek
    Feb 5 at 14:48











  • Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

    – starbeamrainbowlabs
    Feb 5 at 17:10











  • @PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

    – Uncle Billy
    Feb 5 at 18:23
















4















I've discovered that OpenSSH is capable of forwarding UNIX sockets like this:



ssh -R /var/run/program.sock:/var/run/program.sock


My question is whether this extends to abstract unix sockets too.



I've tried the following to no avail:



ssh -nNT -R @laminar:@laminar
ssh -nNT -R unix-abstract:laminar:unix-abstract:laminar


The program in question does support file-based unix sockets, but as it uses abstract sockets by default I'd like to avoid reconfiguring it to simplify matters if possible.



  • OpenSSH (client) version: OpenSSH_7.4p1 Raspbian-10+deb9u4, OpenSSL 1.0.2q 20 Nov 2018

  • OpenSSH (server) version: OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017









share|improve this question



















  • 1





    socat supports abstract sockets. Perhaps you could use it as an intermediate.

    – meuh
    Feb 5 at 14:43






  • 1





    Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

    – Patrick Mevzek
    Feb 5 at 14:48











  • Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

    – starbeamrainbowlabs
    Feb 5 at 17:10











  • @PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

    – Uncle Billy
    Feb 5 at 18:23














4












4








4








I've discovered that OpenSSH is capable of forwarding UNIX sockets like this:



ssh -R /var/run/program.sock:/var/run/program.sock


My question is whether this extends to abstract unix sockets too.



I've tried the following to no avail:



ssh -nNT -R @laminar:@laminar
ssh -nNT -R unix-abstract:laminar:unix-abstract:laminar


The program in question does support file-based unix sockets, but as it uses abstract sockets by default I'd like to avoid reconfiguring it to simplify matters if possible.



  • OpenSSH (client) version: OpenSSH_7.4p1 Raspbian-10+deb9u4, OpenSSL 1.0.2q 20 Nov 2018

  • OpenSSH (server) version: OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017









share|improve this question
















I've discovered that OpenSSH is capable of forwarding UNIX sockets like this:



ssh -R /var/run/program.sock:/var/run/program.sock


My question is whether this extends to abstract unix sockets too.



I've tried the following to no avail:



ssh -nNT -R @laminar:@laminar
ssh -nNT -R unix-abstract:laminar:unix-abstract:laminar


The program in question does support file-based unix sockets, but as it uses abstract sockets by default I'd like to avoid reconfiguring it to simplify matters if possible.



  • OpenSSH (client) version: OpenSSH_7.4p1 Raspbian-10+deb9u4, OpenSSL 1.0.2q 20 Nov 2018

  • OpenSSH (server) version: OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017






ssh openssh port-forwarding unix-sockets






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 at 23:02







starbeamrainbowlabs

















asked Feb 4 at 21:11









starbeamrainbowlabsstarbeamrainbowlabs

1489




1489







  • 1





    socat supports abstract sockets. Perhaps you could use it as an intermediate.

    – meuh
    Feb 5 at 14:43






  • 1





    Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

    – Patrick Mevzek
    Feb 5 at 14:48











  • Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

    – starbeamrainbowlabs
    Feb 5 at 17:10











  • @PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

    – Uncle Billy
    Feb 5 at 18:23













  • 1





    socat supports abstract sockets. Perhaps you could use it as an intermediate.

    – meuh
    Feb 5 at 14:43






  • 1





    Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

    – Patrick Mevzek
    Feb 5 at 14:48











  • Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

    – starbeamrainbowlabs
    Feb 5 at 17:10











  • @PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

    – Uncle Billy
    Feb 5 at 18:23








1




1





socat supports abstract sockets. Perhaps you could use it as an intermediate.

– meuh
Feb 5 at 14:43





socat supports abstract sockets. Perhaps you could use it as an intermediate.

– meuh
Feb 5 at 14:43




1




1





Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

– Patrick Mevzek
Feb 5 at 14:48





Not directly, but with socat you can. You can find same question here: stackoverflow.com/questions/49016346/… (and they are not "abstract" unix sockets, just unix sockets like you have UDP or TCP ones...)

– Patrick Mevzek
Feb 5 at 14:48













Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

– starbeamrainbowlabs
Feb 5 at 17:10





Good ideas, @meuh / @Patrick Mevzek! I think it's easier to reconfigure said program in this instance to use a file-based socket instead, but I'll keep socat in mind for the future :-)

– starbeamrainbowlabs
Feb 5 at 17:10













@PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

– Uncle Billy
Feb 5 at 18:23






@PatrickMevzek if socat wasn't ASSuming that abstract unix socket addresses cannot contain NULs -- that would be great. YUCK

– Uncle Billy
Feb 5 at 18:23











1 Answer
1






active

oldest

votes


















1














No, that's not possible with the standard openssh-portable.



You can look for instance at the unix_listener() function here.



Maybe there are patches floating around, but I'm not going to answer with google search results ;-)



Adding such a thing should be technically easy, but who's going to deal with the "political" part, ie. convince the openssh developers to include the patch?



FWIW, such a patch should necessarily check the peer credentials of the clients connecting to the socket by default; openssh already includes the necessary compat code for that.






share|improve this answer

























  • Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

    – starbeamrainbowlabs
    Feb 5 at 17:09










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498675%2fforward-abstract-unix-socket-over-ssh%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














No, that's not possible with the standard openssh-portable.



You can look for instance at the unix_listener() function here.



Maybe there are patches floating around, but I'm not going to answer with google search results ;-)



Adding such a thing should be technically easy, but who's going to deal with the "political" part, ie. convince the openssh developers to include the patch?



FWIW, such a patch should necessarily check the peer credentials of the clients connecting to the socket by default; openssh already includes the necessary compat code for that.






share|improve this answer

























  • Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

    – starbeamrainbowlabs
    Feb 5 at 17:09















1














No, that's not possible with the standard openssh-portable.



You can look for instance at the unix_listener() function here.



Maybe there are patches floating around, but I'm not going to answer with google search results ;-)



Adding such a thing should be technically easy, but who's going to deal with the "political" part, ie. convince the openssh developers to include the patch?



FWIW, such a patch should necessarily check the peer credentials of the clients connecting to the socket by default; openssh already includes the necessary compat code for that.






share|improve this answer

























  • Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

    – starbeamrainbowlabs
    Feb 5 at 17:09













1












1








1







No, that's not possible with the standard openssh-portable.



You can look for instance at the unix_listener() function here.



Maybe there are patches floating around, but I'm not going to answer with google search results ;-)



Adding such a thing should be technically easy, but who's going to deal with the "political" part, ie. convince the openssh developers to include the patch?



FWIW, such a patch should necessarily check the peer credentials of the clients connecting to the socket by default; openssh already includes the necessary compat code for that.






share|improve this answer















No, that's not possible with the standard openssh-portable.



You can look for instance at the unix_listener() function here.



Maybe there are patches floating around, but I'm not going to answer with google search results ;-)



Adding such a thing should be technically easy, but who's going to deal with the "political" part, ie. convince the openssh developers to include the patch?



FWIW, such a patch should necessarily check the peer credentials of the clients connecting to the socket by default; openssh already includes the necessary compat code for that.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 5 at 3:25

























answered Feb 5 at 2:40









mosvymosvy

7,7321530




7,7321530












  • Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

    – starbeamrainbowlabs
    Feb 5 at 17:09

















  • Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

    – starbeamrainbowlabs
    Feb 5 at 17:09
















Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

– starbeamrainbowlabs
Feb 5 at 17:09





Thanks for the answer! I suspected as much. I'll look at refactoring to use a file-based unix socket instead then. I don't think I've got the skills to add support myself (let alone convince some developers I've never met to include my patch!), so perhaps someone take up the task eventually.

– starbeamrainbowlabs
Feb 5 at 17:09

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498675%2fforward-abstract-unix-socket-over-ssh%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay