Allow a remote computer to access your Mac
If you allow remote login, you can use Secure Shell (SSH) to log in to your Mac from another computer.
You can’t use Telnet to log in to your Mac.
Set up Remote Login
On your Mac, choose Apple menu > System Preferences, then click Sharing.
Select Remote Login.
Selecting Remote Login also enables the secure FTP (sftp) service.
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 from another computer
To log in from another computer, open Terminal (or another SSH app) on that computer, then type:
ssh username@IP address
For example, if your user name is steve, and your computer’s IP address is 10.1.2.3, open Terminal on the other Mac and type:
Don’t know your user name and the IP address for your Mac? It’s easy to find them. Open the Remote Login pane of Sharing preferences; your user name and IP address are shown below the “Remote Login: On” indicator.
Allowing remote login to your Mac can make it less secure. For more information about keeping your Mac secure, see Set up your Mac to be secure.
For more information about using the ssh command, type
man ssh at a Terminal shell prompt.