How to enable SSH login on macOS

If you have a reason to log in to your macOS machine from an external machine in your network, why not enable the SSH daemon.

How to enable SSH login on macOS
If you have a reason to log in to your macOS machine from an external machine in your network, why not enable the SSH daemon.

Your macOS-powered laptop or desktop contains the Secure Shell (SSH) client, which allows you to log in to external servers and desktops that listen for incoming SSH connections. But did you know that you can easily add the SSH daemon to macOS so that you can log in to your macOS device from any machine on the same network?

It’s not only possible, it’s really pretty simple. I’ll show you how.

SEE: Mastermind scammer behind Catch Me If You Can talks about cyber security (TechRepublic download)

The first thing to do is enable remote login. Open System Preferences and click Share. Make sure Remote Login is enabled from the Share window. You may also want to determine who can log in by selecting Only these users and then adding the relevant users.

I strongly advise against allowing all users to log in with SSH, as this could lead to a vulnerability. Once you’ve arranged that, close the System Preferences window and open a terminal window on your Mac. You must now find the IP address of your macOS machine.

To do that you give the command:

ifconfig | less

Also copy your public SSH key from the remote computer to the Mac with the command:

ssh copy id USER @ IP

Where USER is the Mac username and IP is the IP address of the Mac.

With that care you can log in to your Mac, via SSH key verification, so you don’t have to worry about your user password being sniffed away.

Finally, to log in to the Mac from an external machine with SSH, give the command:

ssh USER @ IP

Again, USER is the username on your Mac and IP is the IP address of your Mac.

And that is all that makes SSH registration possible on your macOS machine.

Cyber ​​Security Insider Newsletter

Strengthen the IT security of your organization by staying up to date with the latest news, solutions and best practices for cyber security.
Delivered on Tuesday and Thursday

Register today

Also see

Image: Apple

Leave a Reply