Enable Remote Login (SSH)

Before RemoteConsoleSSH can connect to your computer, the computer needs to be running an SSH server. SSH (Secure Shell) is a protocol that provides encrypted terminal access over a network. Most operating systems include an SSH server, but it is usually turned off by default.

This guide walks you through enabling SSH on macOS, Linux, and Windows, verifying it works, and making sure your firewall is not blocking connections.

ℹ️

Info

You only need to do this once per machine. Once SSH is enabled, it stays on across reboots.

Enable the SSH Server

Option 1: System Settings (Recommended)

  1. Open System Settings (or System Preferences on older macOS).
  2. Navigate to GeneralSharing.
  3. Find Remote Login in the list and toggle it on.
  4. Under "Allow access for," choose All users or select specific user accounts that should be allowed to connect.

Once enabled, you will see a message like "Remote Login: On" along with a command you can use to connect, such as ssh username@My-MacBook.local.

Option 2: Terminal Command

If you prefer the command line, open Terminal and run:

sudo systemsetup -setremotelogin on

You will be prompted for your administrator password. This achieves the same result as the System Settings toggle.

Verify SSH Is Running

Test that the SSH server is accepting connections by connecting to yourself:

ssh localhost

You should be prompted for your password. If you can log in, SSH is working. Type exit to close the test session.

Firewall Configuration

If you have the macOS firewall enabled, you need to allow incoming SSH connections:

  1. Open System SettingsNetworkFirewall.
  2. Click Options (or Firewall Options).
  3. Ensure that incoming connections for Remote Login or sshd are set to Allow.

Alternatively, allow SSH through the firewall from the terminal:

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/sshd

Find Your Hostname and IP Address

You will need your hostname or IP address to connect from RemoteConsoleSSH.

Hostname:

scutil --get LocalHostName

This returns something like My-MacBook. On your local network, other devices can reach this machine at My-MacBook.local.

IP address:

ipconfig getifaddr en0

This returns your Wi-Fi IP address (e.g., 192.168.1.42). If you are using Ethernet, try en1 instead of en0.

Default port: 22 (you do not need to change this unless you have a specific reason to).

Verify Your Setup

Once SSH is enabled on your computer, test the connection from another device on the same network. Open a terminal on a second device and run:

ssh username@hostname

Replace username with your account name on the remote machine, and hostname with the hostname or IP address you found earlier. For example:

ssh john@My-MacBook.local
ssh john@192.168.1.42

If this is the first time connecting, you will be asked to confirm the host's fingerprint. Type yes to continue. Then enter your password. If you see a shell prompt, SSH is working and your machine is ready for RemoteConsoleSSH.

💡

Tip

If the connection hangs or is refused, double-check that the SSH service is running and that your firewall allows traffic on port 22. Also make sure both devices are on the same network.

⚠️

Warning

Enabling SSH exposes your machine to login attempts from anyone who can reach it on the network. Use strong passwords or, better yet, set up SSH key authentication and consider disabling password login entirely. If you are exposing SSH to the internet, take extra precautions or use Tailscale to keep your machine off the public internet entirely.

Next Steps