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?
1 Answer
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?
ncare you using and what Unix are you running?