1

I use ~/.ssh/authorized_keys to allow password-less SSH connection between computers. They worked fine under macOS Catalina, but since I upgraded to macOS Big Sur they no longer work. I can log in to the other macOS all right, but I'm always asked for a password. It looks as if the server ignores my authorized_keys file.

I tried recreating the keys with ssh-keygen, removed the old authorized_keys file and created a new one with ssh-copy-id. Permissions seem fine:

8 -rw-r--r--  1 xxx  staff   2,1K  6 oct 17:20 authorized_keys
8 -rw-------  1 xxx  staff   1,8K  9 oct 17:02 id_rsa
8 -rw-r--r--  1 xxx  staff   401B  9 oct 17:02 id_rsa.pub

I suspect something has changed in /etc/sshd_config, but I can't figure out what.

The problem exists only when I try to ssh from macOS to macOS. From macOS to linux/ubuntu still works as expected (no password prompt).

Some interesting values from ssh -vvv:

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
[...]
debug2: we sent a publickey packet, wait for reply
[...]
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: we sent a keyboard-interactive packet, wait for reply
debug3: receive packet: type 60
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1

When I log in from macOS to Linux/Ubuntu, I see a line:

Server accepts key: /path/to/id_rsa RSA [...]

The line is missing when I try to log in from macOS to another macOS machine.

I also tried different algorithms:

$ ssh-keygen -t dsa
$ ssh-keygen -t ed25519

None of them worked. Does anybody have the same problem?

8
  • Define "no longer work". What is reported if you run ssh -vvv hostname? If you use ssh-copy-id ? Can you log in remotely at all? Oct 6, 2021 at 18:07
  • I added some of the output from ssh -vvv. Yes, I can log in, ssh just asks for the password and seems to ignore the authorized_keys file. This happens in both directions (both Macs are now on Big Sur).
    – digory doo
    Oct 6, 2021 at 18:21
  • 1
    I'm not having the same problem with my Big Sur macOS machines. And, just to make sure, you've copy'n'pasted the contents of Mac1's ~/.ssh/id_rsa.pub into Mac2's ~/.ssh/authorized_keys file?
    – jefe2000
    Oct 6, 2021 at 18:46
  • yes, i did cat id_rsa.pub-from-other-machine >> .ssh/authorized_keys
    – digory doo
    Oct 6, 2021 at 20:25
  • And when you use ssh-copy-id ? Oct 6, 2021 at 21:32

1 Answer 1

1

The problem turned out to be the fact that I had moved my user's home directory from the usual location at /Users/username to a different partition at /Volumes/Data. (A user's home may be anywhere, it can be changed with the Directory Utility.) Somehow, the sshd did not like this. I simply moved the home one directory deeper, to /Volumes/Data/username. Problem gone, now I can log in with the authorized keys without password!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .