How to connect to my Mac through SFTP through the internet?

Thanks to the pandemic, my film company has been doing a lot more remote work. However, we regularly have to back up very large video files onto storage that's located in our office. We have TeamViewer set up which let's me log on to the machine connected to the backup drive but TeamViewer's file transfers are INCREDIBLY slow and I need to upload 100+ GB per backup project.


I have great upload speeds using FTP/SFTP for other servers so I wanted to see how to connect through SFTP to the Mac that's in our office. I went through the steps of going to System Preferences > Sharing > Remote Login and enabling our accounts. I also went under System Preferences > Sharing > File Sharing to make sure the right folders and access are added. All good there!


What' I'm having trouble is figuring out how to properly connect to this Mac through an FTP client such as Filezilla or Cyberduck from my machine at home. Under System Preferences > Sharing > Remote Login, the IP address listed there seems to be a private one so when I enter that IP address in Filezilla, it won't connect. I then looked up the machine's public IP address and tried using that in Filezilla but that didn't work either.


I saw an article explaining that since this machine is connected to an Airport Extreme router, I might need to set up some sort of port forwarding within it. But the article was explicitly about setting up cameras and I don't know if this is the same thing.


So really my question is - how do I setup SFTP access so that I can connect to my Mac over the internet through a FTP client? Thanks!

Posted on Jun 3, 2020 11:38 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 3, 2020 3:09 PM

You do need to setup port forwarding (port mapping as Apple usually refers to it).


Here is an article on setting up port mapping in the Extreme.


https://discussions.apple.com/docs/DOC-3415


And concerning remote access using a Apple router.


https://discussions.apple.com/docs/DOC-3413


It is easy to look up what ports must be opened for SFTP.


https://www.rebex.net/kb/secure-ftp/


But there is some extra complexity here unless you have static public IP from your provider in the office.


Also for business usage VPN is better way to go generally. While SFTP is fine and secure most businesses find running VPN server better way to do things.. as it places your computer at home into the local network.

I would replace your current Extreme at least as the main router with a suitably fast vpn router.

9 replies
Question marked as Top-ranking reply

Jun 3, 2020 3:09 PM in response to ryanesta

You do need to setup port forwarding (port mapping as Apple usually refers to it).


Here is an article on setting up port mapping in the Extreme.


https://discussions.apple.com/docs/DOC-3415


And concerning remote access using a Apple router.


https://discussions.apple.com/docs/DOC-3413


It is easy to look up what ports must be opened for SFTP.


https://www.rebex.net/kb/secure-ftp/


But there is some extra complexity here unless you have static public IP from your provider in the office.


Also for business usage VPN is better way to go generally. While SFTP is fine and secure most businesses find running VPN server better way to do things.. as it places your computer at home into the local network.

I would replace your current Extreme at least as the main router with a suitably fast vpn router.

Jun 4, 2020 10:50 AM in response to ryanesta

If your AirPort was in Bridge Mode, then that indicates that you already have another router there providing DHCP and NAT service. You might call this device your "modem", but it is actually a modem/router or gateway device.


When you changed the AirPort to DHCP and NAT, you saw an error message of Double NAT appear. That means that you are trying to run two routers on the same network when you only want one device acting as the router on a network.


The Double NAT error will not allow port forwarding to work correctly even if you have the settings correct on the AirPort. The AIrPort needs to be set up in Bridge Mode again and then you can try to do port forwarding on your modem/router.


A VPN router would make things tons easier for you.



Jun 4, 2020 2:11 PM in response to ryanesta

I wish there were an easier way to just straight up connect to your Mac remotely.


Back to My Mac (BTMM) worked very well until Apple killed it. Unfortunately Apple determine things like deciding that you should be using iCloud and paying them money for it and not using remote access.


If you need help with this hire a local networking company to help you. You are trying to use home routers and systems when your needs are business. Especially moving around 100x GB files over internet is not within design parameters of home systems.


Bob has pointed out that you actually don't need to do anything to your Airport. Your main router is somewhere else.

Sorry I assumed too much .. one of our first questions in posts like this is to check that your Apple router is indeed the main router.. if not you need to go back to the main router.


I am wondering if you actually control the internet in your office or it is shared? Do you have internet connection in the office which you pay for directly or comes with the building? In the later case what you are attempting might really be impossible since you do NOT own the connection.


Even if you do own the connection it would be exceedingly strange to only run IPv6. However the ISP could have you on CGNAT to limit the use of IPv4 addresses which are expensive.


Your experience with other FTP servers tells me your home connection is good with plenty of upload bandwidth. However your office setup may not have sufficient download bandwidth to match. Exactly what real world speeds do you get at home and in the office on normal Ookla speedtest? Teamviewer may not actually be the problem.


There are much better ways to do things but it does depend on your infrastructure particularly in the office which we have not treated seriously enough. Already mentioned using VPN routers.

Another option is using NAS like Synology at both ends and using their syncing ability over internet to pass files between them. This is also done using VPN.

Using a disk array that is not network but locally attached to the Mac is not going to be the best option when it comes to making fast and secure systems where internet is vital to the service.

Jun 8, 2020 1:50 PM in response to ryanesta

Hmmm.. I thought this might be the case. When you have a shared setup it is difficult to get adequate services for business type setup. VPN service might still be possible. However you cannot run the server in the office.. rather you would run the VPN server in your home and use your Teamviewer to establish the link from the Mac and then pull the files rather than push them.


I still want you to run speed tests on the internet in the office as I am fairly sure on any shared system you will be throttled to fairly low speed to ensure all the other people in the building get equal access. If the download is insufficient you will still be in the same situation your are now no matter how much hardware you setup. You need to work that out first.

Also for this to work you need good upload speed at home but from your previous posts this is not the issue. I would appreciate you giving me the actual numbers though .. speedtest in both your home and office.


If there is adequate bandwidth do a simple test. Setup the SFTP server in your home and the client on the Mac in the office and using team viewer set the mac in the office to download a suitably sized file from your home to see if this works. (Turn off TeamViewer while once you get it started to free up the bandwidth). If so you can automate it using a pair of NAS as I suggested syncing to each other. Or it might be done just using VPN between the Macs. Or SFTP etc.

Jun 4, 2020 8:09 AM in response to LaPastenague

Thank you so much for your response and all of that information!


So I went ahead and followed the guide to that first link. Our Airport Extreme was set to Bridge mode so I changed it to "DHCP and NAT" and set up to forward UDP/TCP ports for port 22, which seems to be the one used for SFTP. What's weird though is after I saved it, if I look up my public IP address, it only shows the IPv6 address while it says IPv4 is "not detected". So I'm not sure how to proceed.


I wish there were an easier way to just straight up connect to your Mac remotely. I may look into a VPN like you mentioned, or maybe try out the SFTP program that's in the App store.


Cheers!

Jun 8, 2020 10:56 AM in response to LaPastenague

Thanks for all the info, everyone!


I did some more followup with my managers and the building we're at. I was a tad disappointed to find out that the building is in control of the main router. The building has internet connections routed to our room so we plug in our Airport Extreme into an ethernet port that's built into the wall. So yeah, we have no way of modifying or replacing the main router in our internet setup.


Do I really have any other viable options? I can't do a VPN router, it seems. TeamViewer's transfer speeds are incredibly slow. We could use services like WeTransfer and Smash but it doubles the work because you're uploading and downloading in separate steps.


Is there at least a way to take one of our drives and make it directly accessible through the internet? I was looking at the Synology 2 Bay NAS DiskStation DS220j (since you brought them up earlier) but do we have to have a VPN for that?

Jun 8, 2020 2:29 PM in response to LaPastenague

Having the VPN setup in my home is an interesting idea, although part of this process was trying to come up with a solution that our whole team could use. I have a mesh router setup but I did read that it allows VPN traffic pass through as long as I put the router in front of my mesh system.


I ran a speed test at the work computer and it has a download speed of 923 Mbps and an upload of 803 Mbps. So it's REALLY fast! The speed test on my home network is 462 Mbps download, 20 Mbps upload.


BTW - I did download the SFTP Server app from the Apple store and tried to run it, but we ran into the same issue: the machine at the office is unable to be found online.

Jun 8, 2020 3:27 PM in response to ryanesta

The speed test on my home network is 462 Mbps download, 20 Mbps upload.


You are going to have issues uploading from your home.. that is the rate determining step.


At 20Mbps it is approx. 7GB per hour.. so for 100GB it would take 14hours give or take. That is certainly going to make this slow and it won't matter what end is server or client the job will still take 14hours ..

Your lucky your workplace has a full gigabit link.


Maybe the IPv6 address can be used.. This is something I am not familiar with and I will see if someone else has a clue.


Jun 8, 2020 7:22 PM in response to ryanesta

Earlier, you mentioned that you had the company's AirPort Extreme configured as a bridge. This would make sense since there is another router upstream of it that is providing you with Internet service. However, with the Extreme in bridge mode any network client being served by that "main" router would also have access to your company's network. A very non-secure situation, but that would be a topic for another post.


If your goal is to use SFTP or a VPN, or any other means to transfer files from a remote location to your company's file server, it would have to be configured on that "main" router. Will or can the building management provide you with that ability?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to connect to my Mac through SFTP through the internet?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.