OS X Yosemite: 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, open Sharing preferences if it isn’t already open (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 Add , then choose who can log in remotely. Users & Groups include 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:
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.