SSH port forwarding: âPrivileged ports can only be forwarded by rootâ error
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I wanted to forward my local 8080 port to the 80 port of the server I want to log in via SSH, so I did:
ssh -L 80:127.0.0.1:8080 -N -f myserver
But I get the error:
Privileged ports can only be forwarded by root.
I can execute sudo commands when logged in that server, but how can I do it for the purposes of port forwarding? (Note: appending sudo
at the beginning of this command doesn't help, because the port 80
is not the port I want to use in localhost, but the port I want to target.)
ssh sudo openssh port-forwarding
add a comment |Â
up vote
0
down vote
favorite
I wanted to forward my local 8080 port to the 80 port of the server I want to log in via SSH, so I did:
ssh -L 80:127.0.0.1:8080 -N -f myserver
But I get the error:
Privileged ports can only be forwarded by root.
I can execute sudo commands when logged in that server, but how can I do it for the purposes of port forwarding? (Note: appending sudo
at the beginning of this command doesn't help, because the port 80
is not the port I want to use in localhost, but the port I want to target.)
ssh sudo openssh port-forwarding
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I wanted to forward my local 8080 port to the 80 port of the server I want to log in via SSH, so I did:
ssh -L 80:127.0.0.1:8080 -N -f myserver
But I get the error:
Privileged ports can only be forwarded by root.
I can execute sudo commands when logged in that server, but how can I do it for the purposes of port forwarding? (Note: appending sudo
at the beginning of this command doesn't help, because the port 80
is not the port I want to use in localhost, but the port I want to target.)
ssh sudo openssh port-forwarding
I wanted to forward my local 8080 port to the 80 port of the server I want to log in via SSH, so I did:
ssh -L 80:127.0.0.1:8080 -N -f myserver
But I get the error:
Privileged ports can only be forwarded by root.
I can execute sudo commands when logged in that server, but how can I do it for the purposes of port forwarding? (Note: appending sudo
at the beginning of this command doesn't help, because the port 80
is not the port I want to use in localhost, but the port I want to target.)
ssh sudo openssh port-forwarding
ssh sudo openssh port-forwarding
asked Aug 29 at 8:20
knocte
1291110
1291110
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
You probably want
ssh -L 8080:127.0.0.1:80 -N -f myserver
Local port comes first. (That's not my political stance!)
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You probably want
ssh -L 8080:127.0.0.1:80 -N -f myserver
Local port comes first. (That's not my political stance!)
add a comment |Â
up vote
3
down vote
accepted
You probably want
ssh -L 8080:127.0.0.1:80 -N -f myserver
Local port comes first. (That's not my political stance!)
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You probably want
ssh -L 8080:127.0.0.1:80 -N -f myserver
Local port comes first. (That's not my political stance!)
You probably want
ssh -L 8080:127.0.0.1:80 -N -f myserver
Local port comes first. (That's not my political stance!)
answered Aug 29 at 9:02
Gerard H. Pille
1,304212
1,304212
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%2f465449%2fssh-port-forwarding-privileged-ports-can-only-be-forwarded-by-root-error%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