If you want to run something as a user, you have to first start it as root and then drop privileges

>if you want to run something as a user, you have to first start it as root and then drop privileges
On what fucking planet is this more secure than just letting users start http servers? Why the fuck are Unix developers so fucking dumb? It's not 1970 anymore, no one uses fucking rsh. setuid is a fucking joke too, there were so many privilege escalation exploits in that heap of shit.

>i want to be able to run a program as any other user without having administrator privileges
>Sup Forums, 2016

You could limit the user to only run the specific commands required to work with Apache, for instance.

It needs root for many things, namely the process probably binds to port 80 and ports under 1000 or something by default require root.

Also, much more priv esc shit in Windows.

> Running httpd
> Not running httpd in a jail

Text quality bait...

typically apache will run as its own user, if you're not launching it as that user, you will need to run it as root so it has permission to switch to that user

oh, and ports 1-1024 are privileged, normal users generally can't listen from them

>lets just let anyone start a service that has access to both the network and the file system!

that much is typically allowed, as long as you use a port >1024

How do you set it up so that it keeps running when your session ends?

>needing a jail when you should be able to just run it as a fucking user that has no permissions

>programs that shouldn't need admin privileges need it because it wants to bind on a fucking port that's not over 1000
Oh no, some user is going to crash my fucking web server and start serving his own shit on that port. Oh wait, that server doesn't even host a web server. This restriction is fucking useless.

>Wahh! Why can't I used privileged ports as a normal user?!

tmux

Why are you quoting my post? I said nothing about ports.

But that is run as root, with setuid, isn't it?

no

>>lets just let anyone start a service that has access to both the network and the file system!
This one? Because I can do literally all of that if I use port 8080 or whatever the fuck as a normal user. It's literally only about ports.

This one: and it's a response to
>if you want to run something as a user, you have to first start it as root and then drop privileges

Notice how neither mention anything about ports.

setcap 'cap_net_bind_service=+ep' /path/to/program


There now your program can bind to ports below 1024 without having to run as root.

Don't you have to run that as root?

ok.
>>i want to be able to run a program as any other user without having administrator privileges
What the fuck does this mean? I'm literally trying to start the httpd as the logged in user. There's nothing about switching users. The only thing that's stopping me is the port restriction.

nohup

Obviously.

Should have mentioned which user.

I guess it's not clear from the screenshot. The error was for port 80 as a normalfag user.

Yeah, seems it's as easy as overriding SIGHUP. Thanks.

Run it on another port, then, and run something like
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080

Tada the problem is solved