Allow a remote computer to access your Mac
Turn on Remote Login to access 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 Settings, click General in the sidebar, then click Sharing. (You may need to scroll down.)
Click next to Remote Login.
Turn on Remote Login.
If you want remote users to have full access to the disk on your Mac, turn on “Allow full disk access for remote users”.
Click the “Allow access for” pop-up menu, then do one of the following:
Let everyone log in to your computer: Click the pop-up menu next to “Allow access for”, then choose “All users”.
Choose who can log in to your computer: Click the pop-up menu next to “Allow access for”, choose “Only these users”, click at the bottom of the list, select users who can log in remotely, then click Select.
Users & Groups includes all the users of your Mac. Network Users and Network Groups include people on your network.
To remove a user from the list, select the user, then click .
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.
Find the SSH command to use to log in to your Mac from another computer
On your Mac, choose Apple menu > System Settings, click General in the sidebar, then click Sharing. (You may need to scroll down.)
Click next to Remote Login.
Note the SSH command 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.