Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Forwarding IPv4 Ports to IPv6-only Hosts" wrong information #2

Open
Thermi opened this issue Sep 7, 2016 · 2 comments
Open

"Forwarding IPv4 Ports to IPv6-only Hosts" wrong information #2

Thermi opened this issue Sep 7, 2016 · 2 comments

Comments

@Thermi
Copy link

Thermi commented Sep 7, 2016

In the article "forwarding-ipv4-to-ipv6" , you're writing the following:

Only drawback is that we have to run socat as root because port 22 is one of those 'special' ports only root can open... ah well, can't have everything.

That's wrong. if you run socat with CAP_NET_BIND_SERVICE, you can bind to that port just fine, without running it as root.
That's what man 7 capabilities says about CAP_NET_BIND_SERVICE:

       CAP_NET_BIND_SERVICE
              Bind  a socket to Internet domain privileged ports (port numbers
              less than 1024).

The proper thing to do in that case would be to run that particular instance of socat as a system service as an unprivileged user, but with the CAP_NET_BIND_SERVICE capability. That could be easily done using a systemd unit file. Setting the capability on the file would be a very bad idea.

@EffinMaggie
Copy link
Member

Hey Thermi,

Good point, though that's entirely Linux-specific and doesn't work like that on BSDs. I'd be happy to amend it, unless you want to send a pull request :).

@Thermi
Copy link
Author

Thermi commented Sep 7, 2016

I'll let you do the honors. I guess one can use capsicum to achieve the same thing on FreeBSD. I'm not aware of something similiar for other 'BSDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants