SSH roadblocks

When connecting to a Macintosh remotely via SSH, you can run into difficulty and connections may fail. Here are some common reasons:

Remote Login via SSH not enabled

The Macintosh must be configured to enable Remote Login via SSH, as described in Enabling remote logins.

SSH configuration issues

SSH servers are highly configurable via the file /etc/sshd_config. Some configurations can deny remote connections in certain situations. See man sshd_config to learn more.

Firewalls

If your Macintosh is behind a firewall, say, inside a company’s private network, you might not be able to connect to it. (The Mac’s own Firewall application will not interfere with Remote Login.)

Dynamic IP addresses

Your Macintosh’s internet service provider might change the Mac’s IP address on a regular basis. (In technical terms, your Mac is using DHCP to obtain its IP address.) If so, and you don’t know the current IP address, you won’t be able to connect to your Mac from the outside. This is common for home computer setups. You can get around this issue by signing up for a dynamic DNS service, such as Dyn (http://www.dyn.com), that assigns a consistent hostname to your Mac that you can use externally.

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.