I have been using FreeBSD running an a virtual machine at DigitalOcean.com.
I use Secure Shell (SSH) from my Mac to remote into a console session on the VM. I used ssh-keygen
to create the pair of encryption keys.
I deployed the public one copied to the FreeBSD SSH server. I did so via a back-door web-page supplied by Digital Ocean, pasting the text contents of the public key to a text field in a form.
That works well, logging me in for both root
and freebsd
users present by default on my new FreeBSD VM. When I connect via either the root
or freebsd
user accounts via ssh, I am prompted to provide the passphrase protecting my local private key.
ssh root@192.0.2.10
…or…
ssh freebsd@192.0.2.10
Then I installed the Postgres database system onto this FreeBSD server. As part of the scripts used to build and install Postgres, a third user account is added to the FreeBSD machine. By convention, the new account is named postgres
. I gave that user a password using the passwd
utility.
When I connect to the FreeBSD server as that user:
ssh postgres@192.0.2.10
…I am prompted for that postgres
user’s own password. I am not prompted for the password protecting my local private encryption key.
➥ Why is the postgres
user treated differently than root
& freebsd
with regard to using the public/private SSH keys to log me in?
FYI, I never touched any authorized_keys
file on the remote SSH server (my FreeBSD VM).
My Question here may be a duplicate of Public SSH keys not working for all users on same server, I’m not sure.