0

When I run the command nc -l -p 443 it starts listening but when I try connecting to it it fails. A few hours later I tried with verbose mode nc -lvp 443 and it printed out listening on [any] 2443. Then I figured out that it's not listening on the correct port. Any ideas why it's listening on port 2443 instead of port 443?

2
  • 1
    You are not doing this as root, I guess? Commented May 21, 2019 at 9:53
  • 1
    What implementation of nc are you using and what Unix are you running? Commented May 21, 2019 at 10:15

1 Answer 1

0

With default setup, only root can bind to ports lower than 1024.

panki@REDACTED:~$ nc -lvp 443                                                                                         
Can't grab 0.0.0.0:443 with bind : Permission denied                                                                    
panki@REDACTED:~$ sudo !!                                                                                             
sudo nc -lvp 443                                                                                                        
listening on [any] 443 ...

More about this is already said here: Why are the first 1024 ports restricted to the root user only?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.