How to use privileges port less than 1024 with non-root user

original url:

Using setcap command, for example, if you tomcat run with 80 with user tomcat

# setup the net bind program
setcap 'cap_net_bind_service=+epi' $JAVA_HOME/bin/java
# start tomcat
systemctl start tomcat
# check port
netstat -ant |grep 444
tcp        0      0   *               LISTEN

All done!

How to become a hacker —

There are basically five kinds of things you can do to be respected by hackers:

1. The first (the most central and most traditional) is to write programs that other hackers think are fun or useful, and give the program sources to the whole hacker culture to use.

Hackerdom’s most revered demigods are people who have written large, capable programs that met a widespread need and given them away, so that now everyone uses them.

2. Help test and debug free software

They also serve who stand and debug free software. In this imperfect world, we will inevitably spend most of our software development time in the debugging phase. That’s why any free-software author who’s thinking will tell you that good beta-testers (who know how to describe symptoms clearly, localize problems well, can tolerate bugs in a quickie release, and are willing to apply a few simple diagnostic routines) are worth their weight in rubies. Even one of these can make the difference between a debugging phase that’s a protracted, exhausting nightmare and one that’s merely a salutory nuisance.
If you’re a newbie, try to find a program under development that you’re interested in and be a good beta-tester. There’s a natural progression from helping test programs to helping debug them to helping modify them. You’ll learn a lot this way, and generate good karma with people who will help you later on.

3. Publish useful information.

Another good thing is to collect and filter useful and interesting information into Web pages or documents like FAQs (Frequently Asked Questions lists), and make those generally available.
Maintainers of major technical FAQs get almost as much respect as free-software authors.

4. Help keep the infrastructure working.

The hacker culture (and the engineering development of the Internet, for that matter) is run by volunteers. There’s a lot of necessary but unglamorous work that needs done to keep it going — administering mailing lists, moderating newsgroups, maintaining large software archive sites, developing RFCs and other technical standards.
People who do this sort of thing well get a lot of respect, because everybody knows these jobs are huge time sinks and not much fun as playing with code. Doing them shows dedication.

5. Serve the hacker culture itself.

Finally, you can serve and propagate the culture itself (by, for example, writing an accurate primer on how to become a hacker :-)). This is not something you’ll be positioned to do until you’ve been around for while and become well-known for one of the first four things.
The hacker culture doesn’t have leaders, exactly, but it does have culture heroes and tribal historians and spokespeople. When you’ve been in the trenches long enough, you may grow into one of these. Beware: hackers distrust blatant ego in their tribal elders, so visibly reaching for this kind of fame is dangerous. Rather than striving for it, you have to sort of position yourself so it drops in your lap, and then be modest and gracious about your status.

Points For Style

Again, to be a hacker, you have to enter the hacker mindset. There are some things you can do when you’re not a computer that seem to help. They’re not substitutes for hacking(nothing is) but many hackers do them, and feel that they connect in some basic way with the essence of hacking.

  • Read science fiction. Go to science fiction conventions (a good way to meet hackers and proto-hackers).
  • Study Zen, and/or take up martial arts. (The mental discipline seems similar in important ways.)
  • Develop an analytical ear for music. Learn to appreciate peculiar kinds of music. Learn to play some musical instrument well, or how to sing.
  • Develop your appreciation of puns and wordplay.
  • Learn to write your native language well. (A surprising number of hackers, including all the best ones I know of, are able writers.)

The more of these things you already do, the more likely it is that you are natural hacker material. Why these things in particular is not completely clear, but they’re connected with a mix of left- and right-brain skills that seems to be important (hackers need to be able to both reason logically and step outside the apparent logic of a problem at a moment’s notice).