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)
- Open System Settings (or System Preferences on older macOS).
- Navigate to General → Sharing.
- Find Remote Login in the list and toggle it on.
- 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 onYou 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 localhostYou 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:
- Open System Settings → Network → Firewall.
- Click Options (or Firewall Options).
- 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/sshdFind Your Hostname and IP Address
You will need your hostname or IP address to connect from RemoteConsoleSSH.
Hostname:
scutil --get LocalHostNameThis returns something like My-MacBook. On your local network, other devices can reach this machine at My-MacBook.local.
IP address:
ipconfig getifaddr en0This 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@hostnameReplace 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.42If 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
- Set up network access with Tailscale so your phone can reach your computer from anywhere.
- Configure SSH key authentication for a more secure and convenient login.
- Install tmux for persistent terminal sessions that survive disconnections.