SSH connect to a UNIX socket instead of hostname
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
Short question:
How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:
public> ssh /home/username/test.sock
"ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"
Long Question:
The Problem I try to solve, is to connect from my (public
) university server to my (local
) PC, which is behind NAT and not visible to public.
The canonical solution is to create a ssh proxy/tunnel to local
on public
:
local> ssh -NR 2222:localhost:22 public
But this is not possible, as the administration prohibits creating ports.
So I have thought about using UNIX socket instead, which works:
local> ssh -NR /home/username/test.sock:localhost:22 public
But now, how can I connect to it with ssh?
linux ssh ssh-tunneling port-forwarding unix-sockets
add a comment |Â
up vote
3
down vote
favorite
Short question:
How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:
public> ssh /home/username/test.sock
"ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"
Long Question:
The Problem I try to solve, is to connect from my (public
) university server to my (local
) PC, which is behind NAT and not visible to public.
The canonical solution is to create a ssh proxy/tunnel to local
on public
:
local> ssh -NR 2222:localhost:22 public
But this is not possible, as the administration prohibits creating ports.
So I have thought about using UNIX socket instead, which works:
local> ssh -NR /home/username/test.sock:localhost:22 public
But now, how can I connect to it with ssh?
linux ssh ssh-tunneling port-forwarding unix-sockets
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Short question:
How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:
public> ssh /home/username/test.sock
"ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"
Long Question:
The Problem I try to solve, is to connect from my (public
) university server to my (local
) PC, which is behind NAT and not visible to public.
The canonical solution is to create a ssh proxy/tunnel to local
on public
:
local> ssh -NR 2222:localhost:22 public
But this is not possible, as the administration prohibits creating ports.
So I have thought about using UNIX socket instead, which works:
local> ssh -NR /home/username/test.sock:localhost:22 public
But now, how can I connect to it with ssh?
linux ssh ssh-tunneling port-forwarding unix-sockets
Short question:
How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:
public> ssh /home/username/test.sock
"ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"
Long Question:
The Problem I try to solve, is to connect from my (public
) university server to my (local
) PC, which is behind NAT and not visible to public.
The canonical solution is to create a ssh proxy/tunnel to local
on public
:
local> ssh -NR 2222:localhost:22 public
But this is not possible, as the administration prohibits creating ports.
So I have thought about using UNIX socket instead, which works:
local> ssh -NR /home/username/test.sock:localhost:22 public
But now, how can I connect to it with ssh?
linux ssh ssh-tunneling port-forwarding unix-sockets
edited Jun 25 at 16:13
sebasth
5,78221640
5,78221640
asked Jun 25 at 15:24
bvolkmer
1747
1747
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
You should be able to do utilizing socat
and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat
establishes two-way communication between STDIN/STDOUT (socat
and ssh client) and your UNIX socket.
ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
You should be able to do utilizing socat
and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat
establishes two-way communication between STDIN/STDOUT (socat
and ssh client) and your UNIX socket.
ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo
add a comment |Â
up vote
6
down vote
accepted
You should be able to do utilizing socat
and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat
establishes two-way communication between STDIN/STDOUT (socat
and ssh client) and your UNIX socket.
ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
You should be able to do utilizing socat
and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat
establishes two-way communication between STDIN/STDOUT (socat
and ssh client) and your UNIX socket.
ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo
You should be able to do utilizing socat
and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat
establishes two-way communication between STDIN/STDOUT (socat
and ssh client) and your UNIX socket.
ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo
edited Jun 25 at 15:54
answered Jun 25 at 15:34
sebasth
5,78221640
5,78221640
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451788%2fssh-connect-to-a-unix-socket-instead-of-hostname%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password