01Why use a key
SSH works with a password, but you have to type it every time, and someone may try to guess it again and again. Key login means you generate a pair of keys on your own computer: the private key stays on your computer, and the public key goes on the Mac you want to log in to. When you connect, the two sides check each other automatically. You no longer type a password, and a key is harder to crack than a password.
02Step 1: Generate a key on your computer
In the terminal on your own computer (PowerShell on Windows), run:
ssh-keygen -t ed25519
- Just press Return at each prompt. The private key is saved to ~/.ssh/id_ed25519 by default, and the public key is the file with the same name plus .pub.
- When it asks you to set a passphrase, we suggest you set one. Then even if someone takes your private key file, they cannot use it without the passphrase.
- If Windows says it cannot find ssh-keygen: open Settings > System > Optional features and check whether “OpenSSH Client” is there. If not, add it. Many computers already have it installed.
03Step 2: Put the public key on the Mac
If your computer is a Mac or runs Linux, the built-in ssh-copy-id is the easiest way:
ssh-copy-id USER@ADDRESS
Windows does not have ssh-copy-id. Run this line in PowerShell instead; it does the same thing:
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh USER@ADDRESS "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
This step asks for the Mac account’s password one last time. After that, ssh USER@ADDRESS connects without a password.
Connecting to a NexMini Mac: the address is this Mac’s address in Tailscale (it starts with 100.), and the username is the Mac account shown in My machines. To install Tailscale, see the guide “Ways to connect to a remote Mac mini”.
04Step 3: Give it a short name
Add a few lines to the ~/.ssh/config file on your computer (create the file if it does not exist):
Host mymac
HostName 100.x.x.x
User YOUR_MAC_USERNAME
IdentityFile ~/.ssh/id_ed25519
Replace 100.x.x.x with the Mac’s address. From then on, ssh mymac is all you need to connect, and editors such as VS Code can use the same name for remote connections.
05Connecting to your own Mac: turn on Remote Login first
To SSH into your own Mac, first open System Settings > General > Sharing on that Mac, click the ⓘ next to Remote Login, turn it on, then choose which users can log in. This step needs administrator rights. On a NexMini Mac it is already turned on for you.
06Security reminders
- Keep the private key (the file without .pub) only on your own computer. Do not send it to anyone, and do not upload it to cloud storage or a code repository.
- If you change computers or lose one: open ~/.ssh/authorized_keys on the Mac and delete the line for that computer.
- Give each computer its own key. Do not share one private key across several computers.

