Passwordless SSH between MacOS and MacOS not working

Solution 1:

If you tell your config file about the setup it will work.

Open ~/.ssh/config

Add this:

Host whateverYouWannaCallIt
  Hostname      192.168.1.235
  User          me
  IdentityFile  ~/.ssh/id_rsa

Then you can do this:

ssh whateverYouWannaCallIt

I recommend when creating the ssh key, to not use a generic one and give it a name for the machine, so one key per computer. You don't want to use the same key for more than one machine... but that's what will happen if you keep using id_rsa.

So as step one, do something more like this:

ssh-keygen -t rsa -b 3072 -f ~/.ssh/theServersName.rsa
...
ssh-copy-id -i ~/.ssh/theServersName.rsa.pub [email protected]

Then point IdentityFile to the right place:

Host theServersName
  Hostname      192.168.1.235
  User          me
  IdentityFile  ~/.ssh/theServersName.rsa