How do I forward 443 to my machine from remote?
This is authorized. I just need to figure out how to do it.
I want to forward web traffic from the target machine to my local machine such that when something on the remote machine tries to communicate over port 443 (https), it's perspective is from my local box.
Problem I'm trying to solve is as follows:
We have docker training going on in one specific machine we built just for this task. Right now, it can't access github and we need that for the training. Our team is authorized access to github explicitly.
Having what I think is probably just a lot of trouble with the syntax.
From my desktop machine, have tried:
ssh -vnNT -R 443:[ my ip addr from remote's perspective ]:443 [ remote host name ]
What I'm seeing in the debug output is:
debug1: Authentication succeeded (publickey).
Authenticated to remoteHostName ([remoteIpAddr]:22).
debug1: Remote connections from LOCALHOST:443 forwarded to local address [ my ip ]:443
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Server has disabled port forwarding.
debug1: remote forward failure for: listen 443, connect [my ip]:443
Warning: remote port forwarding failed for listen port 443
debug1: All remote forwarding requests processed
Now you would think that the above would mean that port forwarding was not configured on the server or set to 'no'. What I have set is:
AllowTcpForwarding yes
GatewayPorts yes
...and I've restarted it twice. :-/
ssh port-forwarding remote
add a comment |
This is authorized. I just need to figure out how to do it.
I want to forward web traffic from the target machine to my local machine such that when something on the remote machine tries to communicate over port 443 (https), it's perspective is from my local box.
Problem I'm trying to solve is as follows:
We have docker training going on in one specific machine we built just for this task. Right now, it can't access github and we need that for the training. Our team is authorized access to github explicitly.
Having what I think is probably just a lot of trouble with the syntax.
From my desktop machine, have tried:
ssh -vnNT -R 443:[ my ip addr from remote's perspective ]:443 [ remote host name ]
What I'm seeing in the debug output is:
debug1: Authentication succeeded (publickey).
Authenticated to remoteHostName ([remoteIpAddr]:22).
debug1: Remote connections from LOCALHOST:443 forwarded to local address [ my ip ]:443
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Server has disabled port forwarding.
debug1: remote forward failure for: listen 443, connect [my ip]:443
Warning: remote port forwarding failed for listen port 443
debug1: All remote forwarding requests processed
Now you would think that the above would mean that port forwarding was not configured on the server or set to 'no'. What I have set is:
AllowTcpForwarding yes
GatewayPorts yes
...and I've restarted it twice. :-/
ssh port-forwarding remote
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31
add a comment |
This is authorized. I just need to figure out how to do it.
I want to forward web traffic from the target machine to my local machine such that when something on the remote machine tries to communicate over port 443 (https), it's perspective is from my local box.
Problem I'm trying to solve is as follows:
We have docker training going on in one specific machine we built just for this task. Right now, it can't access github and we need that for the training. Our team is authorized access to github explicitly.
Having what I think is probably just a lot of trouble with the syntax.
From my desktop machine, have tried:
ssh -vnNT -R 443:[ my ip addr from remote's perspective ]:443 [ remote host name ]
What I'm seeing in the debug output is:
debug1: Authentication succeeded (publickey).
Authenticated to remoteHostName ([remoteIpAddr]:22).
debug1: Remote connections from LOCALHOST:443 forwarded to local address [ my ip ]:443
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Server has disabled port forwarding.
debug1: remote forward failure for: listen 443, connect [my ip]:443
Warning: remote port forwarding failed for listen port 443
debug1: All remote forwarding requests processed
Now you would think that the above would mean that port forwarding was not configured on the server or set to 'no'. What I have set is:
AllowTcpForwarding yes
GatewayPorts yes
...and I've restarted it twice. :-/
ssh port-forwarding remote
This is authorized. I just need to figure out how to do it.
I want to forward web traffic from the target machine to my local machine such that when something on the remote machine tries to communicate over port 443 (https), it's perspective is from my local box.
Problem I'm trying to solve is as follows:
We have docker training going on in one specific machine we built just for this task. Right now, it can't access github and we need that for the training. Our team is authorized access to github explicitly.
Having what I think is probably just a lot of trouble with the syntax.
From my desktop machine, have tried:
ssh -vnNT -R 443:[ my ip addr from remote's perspective ]:443 [ remote host name ]
What I'm seeing in the debug output is:
debug1: Authentication succeeded (publickey).
Authenticated to remoteHostName ([remoteIpAddr]:22).
debug1: Remote connections from LOCALHOST:443 forwarded to local address [ my ip ]:443
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Server has disabled port forwarding.
debug1: remote forward failure for: listen 443, connect [my ip]:443
Warning: remote port forwarding failed for listen port 443
debug1: All remote forwarding requests processed
Now you would think that the above would mean that port forwarding was not configured on the server or set to 'no'. What I have set is:
AllowTcpForwarding yes
GatewayPorts yes
...and I've restarted it twice. :-/
ssh port-forwarding remote
ssh port-forwarding remote
edited Jan 3 at 18:11
NonYaBidnezz
asked Jan 3 at 18:06
NonYaBidnezzNonYaBidnezz
1015
1015
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31
add a comment |
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31
add a comment |
1 Answer
1
active
oldest
votes
1) sshd_config is not the only source of forwarding options.
Even if the server allows forwarding globally, individual connections (specific public keys) may be restricted using options specified in the remote ~/.ssh/authorized_keys
file.
If you use OpenSSH "certificates", then restrictions may be encoded within the certificate itself. Use ssh-keygen -L
to check.
2) You need root privileges on the remote system for this.
SSH port forwarding involves ordinary sockets listening for TCP connections on one end, making connections on another. (So it's more like proxying than the packet-level port forwarding seen on routers.)
With -R
, the listening sockets are set up by the sshd worker process that handles your connection. That process runs under your own (remote) user ID, so it is subject to the same restrictions as your own programs would. In particular, it isn't allowed to bind sockets to a port below 1024 (the "privileged port" range) unless it has root privileges or something similar – which directly means that you must log in as root@ to the remote system.
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390259%2fhow-do-i-forward-443-to-my-machine-from-remote%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) sshd_config is not the only source of forwarding options.
Even if the server allows forwarding globally, individual connections (specific public keys) may be restricted using options specified in the remote ~/.ssh/authorized_keys
file.
If you use OpenSSH "certificates", then restrictions may be encoded within the certificate itself. Use ssh-keygen -L
to check.
2) You need root privileges on the remote system for this.
SSH port forwarding involves ordinary sockets listening for TCP connections on one end, making connections on another. (So it's more like proxying than the packet-level port forwarding seen on routers.)
With -R
, the listening sockets are set up by the sshd worker process that handles your connection. That process runs under your own (remote) user ID, so it is subject to the same restrictions as your own programs would. In particular, it isn't allowed to bind sockets to a port below 1024 (the "privileged port" range) unless it has root privileges or something similar – which directly means that you must log in as root@ to the remote system.
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
add a comment |
1) sshd_config is not the only source of forwarding options.
Even if the server allows forwarding globally, individual connections (specific public keys) may be restricted using options specified in the remote ~/.ssh/authorized_keys
file.
If you use OpenSSH "certificates", then restrictions may be encoded within the certificate itself. Use ssh-keygen -L
to check.
2) You need root privileges on the remote system for this.
SSH port forwarding involves ordinary sockets listening for TCP connections on one end, making connections on another. (So it's more like proxying than the packet-level port forwarding seen on routers.)
With -R
, the listening sockets are set up by the sshd worker process that handles your connection. That process runs under your own (remote) user ID, so it is subject to the same restrictions as your own programs would. In particular, it isn't allowed to bind sockets to a port below 1024 (the "privileged port" range) unless it has root privileges or something similar – which directly means that you must log in as root@ to the remote system.
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
add a comment |
1) sshd_config is not the only source of forwarding options.
Even if the server allows forwarding globally, individual connections (specific public keys) may be restricted using options specified in the remote ~/.ssh/authorized_keys
file.
If you use OpenSSH "certificates", then restrictions may be encoded within the certificate itself. Use ssh-keygen -L
to check.
2) You need root privileges on the remote system for this.
SSH port forwarding involves ordinary sockets listening for TCP connections on one end, making connections on another. (So it's more like proxying than the packet-level port forwarding seen on routers.)
With -R
, the listening sockets are set up by the sshd worker process that handles your connection. That process runs under your own (remote) user ID, so it is subject to the same restrictions as your own programs would. In particular, it isn't allowed to bind sockets to a port below 1024 (the "privileged port" range) unless it has root privileges or something similar – which directly means that you must log in as root@ to the remote system.
1) sshd_config is not the only source of forwarding options.
Even if the server allows forwarding globally, individual connections (specific public keys) may be restricted using options specified in the remote ~/.ssh/authorized_keys
file.
If you use OpenSSH "certificates", then restrictions may be encoded within the certificate itself. Use ssh-keygen -L
to check.
2) You need root privileges on the remote system for this.
SSH port forwarding involves ordinary sockets listening for TCP connections on one end, making connections on another. (So it's more like proxying than the packet-level port forwarding seen on routers.)
With -R
, the listening sockets are set up by the sshd worker process that handles your connection. That process runs under your own (remote) user ID, so it is subject to the same restrictions as your own programs would. In particular, it isn't allowed to bind sockets to a port below 1024 (the "privileged port" range) unless it has root privileges or something similar – which directly means that you must log in as root@ to the remote system.
edited Jan 3 at 18:29
answered Jan 3 at 18:23
grawitygrawity
234k36495551
234k36495551
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
add a comment |
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Regarding authorized_keys, you mean the user@host information at the end of the key?
– NonYaBidnezz
Jan 4 at 14:47
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
Logging in as root is a non-starter. :-/
– NonYaBidnezz
Jan 4 at 15:03
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
ssh-keygen -L returns "invalid Key: invalid format" Note that this is a Mac.
– NonYaBidnezz
Jan 4 at 15:10
add a comment |
Thanks for contributing an answer to Super User!
- 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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390259%2fhow-do-i-forward-443-to-my-machine-from-remote%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Why not use an IPTABLES dnat rule rather then ssh?
– davidgo
Jan 4 at 1:31