open port

How can I open a port on linux machine ???

If you mean listening on port:

nc -lp <port>
1 Like

ok thanks radoulov....what if I want to close a port??

close the application that opens the port

dears,

I tried to use nc -l -p 21 -e /program

but this well success for only one time connection after that the nc will be closed???? how can I make the nc running continously ...I need to make the listening for the specified port continous?????

any help????

while :;do
    nc -vlp 21 -e /program
done>your.log 2>your_error.log

Make a script and run in nohup.