Allow a remote computer to access your Mac
Turn on Remote Login to access to your Mac from another computer using SSH (Secure Shell Protocol) or SFTP (SSH File Transfer Protocol).
Set up Remote Login on your Mac
On your Mac, choose Apple menu > System Preferences, click Sharing , then select Remote Login.
Select the Remote Login tickbox.
If needed, select the “Allow full disk access for remote users” checkbox.
Specify which users can log in:
All users: Any of your computer’s users and anyone on your network can log in.
Only these users: Click the Add button , then choose who can log in remotely. Users & Groups includes all the users of your Mac. Network Users and Network Groups include people on your network.
Log in to your Mac from another computer
On the other computer, open the Terminal app (if it’s a Mac) or an SSH client.
Type the ssh command, then press Return.
The basic ssh command format is:
ssh username@hostname
The hostname can be an IP address or a domain name. For example, if your username is steve and your computer’s IP address is 10.1.2.3, enter the following:
ssh steve@10.1.2.3
Enter your password, then press Return.
To find the SSH command to use to log in to your Mac from another computer, choose Apple menu > System Preferences, click Sharing , then select Remote Login. The SSH command is shown below the “Remote Login: On” indicator.
Allowing remote login to your Mac can make it less secure. See Set up your Mac to be secure.