Remotely access a friend’s files over internet (natively + not screen sharing)

remote desktop

I am trying to help a friend organize his computer remotely over the internet. Screen sharing through macOS Messages is far too laggy to be efficient. I've been searching and reading about macOS's native remote file sharing options (File Sharing, Remote Login, Remote Management, Apple Remote Desktop, etc), but I can't for the life of me figure it all out or quite understand how it all works.

Is it possible to set up his computer so that I can remotely log into it from my own computer over the internet, through Finder, and organize his files for him, using a native macOS feature/protocol?

We are both running the latest version of High Sierra and running MacBook Pros.

EDIT: Well I've determined that the answer is no, there is no way to access my friend's files over the internet using a mounted disk in Finder, as you might over a local Wi-Fi network. The alternative is some deep Terminal usage and router set-up, which is a bit more than I can devote my time to, but I've marked it as the solution, as it does answer my question.

Best Answer

Using ssh in Terminal would be my preferred way to achieve this but your friend will likely need to setup a rule on their firewall/router to let you make inbound ssh connections to their Mac.

Once you're in it's the same as being in a Terminal locally on their Mac so you have full control over their filesystem (assuming you login with their credentials). Your friend could create another account for you to login with but you'll need Administrative rights on that account to use sudo to manipulate files in their home directory.

IPV4 with NAT will require a port 22 forward on their router to the internal IP address of their Mac. If IPv6 is available to you both then it will likely just need a hole poked in your friends firewall/router to allow return traffic to your own IP. If your friend's Mac is not in a fixed network location and is moving around and changing networks then this method won't work.

If you're new to this I would suggest trying this out on the same network first before you try doing it over the internet and have their firewall/router in the way.

To enable ssh login on your friends Mac go to System Preferences -> Sharing and enable Remote Login.

To ssh to your friends laptop in a Terminal you'll want something like:

ssh username@ipaddress

in a Terminal on your machine where username is their 'shortname' on their Mac and ipaddress is their public IP. Typing

id

into a Terminal on their Mac is a quick and easy way to determine their 'shortname'. It's the name in brackets after the uid.

The password required will be the same as their normal desktop login password.

Once you're logged in via ssh you have access to all the tools you would be able to use in Terminal on their local machine (like cp, mv, rm etc).

If you use this method and get things working and you want to leave Remote Login on all the time you should consider generating and using ssh keys and disable ssh password based logins altogether. Open ssh ports tend to attract lots of attention.

Ideally you should also make the firewall rules on their firewall/router specific to your public IP, though that can be a pain if your public IP is assigned dynamically by your ISP or you move network locations a lot.