Which Ports to use?

by Amit Biswas Posted Feb. 16, 2017

Before you start, make sure you know how to SSH to the server. Learn about that here.

If you are home (read: not connected to NYU wifi) you have to use NYU VPN). Scroll down the page to see the download link for the vpn client for your platform (Windows, Mac etc.). When the vpn client asks for the server address use vpn.nyu.edu and use your typical netid and password to authenticate.

If you want to run an app on the server, it is useful sometimes to bind your application to a port. On Code, the ports 8080-10000/tcp are open through the firewall.

There is a chance that someone might be using one of those ports. An easy way to check for available ports is to run this command: netstat -lant. The options lant for netstat refer to [--listening|-l], [--all|-a], [--numeric|-n], and [--tcp|-t] respectively. You should see all the tcp ports that are currently in use by other applications.

netstat command
Figure 1. Netstat command.

In Figure 1, you can see that none of the ports 8080-10000 show up in the output of netstat. So, in this instance, any port in that range is safe to use.