In order to enable SFTP, you must first enable SSH on your Mac, but first there are some things you should have before you begin: Mac running OS X, a router with port-mapping features, and an SFTP client.
To begin, you need to set up your Mac to use a specific IP address on your local network, and configure your router to forward the SSH port to your Mac. This will make your router to relocate the incoming SSH request to your specific Mac. To do this, open System Preferences and navigate to Network > AirPort (or Ethernet) > Advanced > TCP/IP, and select “Using DHCP with manual address.
After configuring the router and IP address on your Mac, let’s make the SSH service begin to allow access to your Mac over the Internet. To do this, navigate to System Preferences > Sharing, and enable the “Remote Login” feature. This will enable users of the system to connect via SSH and SFTP remotely (because we’ve set up the port forwarding feature of your router).
Now you’re totally ready to connect to your Mac remotely. To do so, you’ll need to get the IP Address of your Internet connection. Visit a site like IPChicken from your home Internet connection and make note of the address. If you wish to use a different name to connect to your Mac instead of the public IP address, then you’ll need to use a service like DynDNS that will automatically trace your public IP address and provide access through a hostname.