The macOS and OSX operating systems come with built in FTP, TFTP, SFTP, and HTTP servers. Here is how to enable them and use them.
To start an FTP server use this terminal command:
Users will need to authenticate to the macOS system using standard logins that are already on the macOS. When someone logs in, they will arrive in
To stop the FTP server, run the following:
The directory that serves files is
To stop the TFTP server, either reboot or use this command:
This one is different. Go to system preferences then
Sharing. Check the box to enabe
Remote Login. Once this is done, other people will be able to ssh and sftp to your macOS system.
Apache comes bundled with macOS. To start it, run this command.
By default the files will be served from
To disable the server, either reboot or do this command:
To check to see what’s running, run the command:
This will show you which ports are open on your macOS. For example if you have Apache running, you will see the following:
- HTTP = TCP 80
- FTP = TCP 21
- SSH = TCP 22
- SFTP = TCP 22
- TFTP = UDP 69
Note that TFTP is on UDP and won’t say listen. Just run
netstat -an | grep 69 to find if it’s running.