1. On the Mac that you want to control via remote, launch System Preferences and choose Sharing. Click the lock icon and enter your Admin password to unlock the preference.
2. Within that preference enable the Remote Login option. In this window you’ll see the command for accessing your remote Mac, for example: ssh email@example.com (The address with be different). Close System Preferences.
3. On the local Mac (which is running on the same local network as the remote Mac) launch the Terminal and enter
4. After a short delay enter your password for the remote Mac.
sudo shutdown -r now
6. Hit Enter, the type the password of the administrative user, enter again. The remote Mac will restart.