I have SSH keys set up for my account and root. If I set PasswordAuthentication to no in the SSH server configuration, could that lock out system accounts or cause other problems?
Is it safe to turn off SSH password logins?
Answers
That setting disables SSH login using account passwords. It does not generally disable the accounts themselves or change how local services authenticate. The main risk is locking yourself out if the key login is not actually working, so test it before changing the setting.
Reply to this answer
Do the change while you still have a working session open, then test a second connection in a separate terminal. Check the SSH server configuration for other settings that might affect key authentication, and reload or restart the service only after validating the configuration. Keep a way to access the machine locally or through its console in case something goes wrong.
Reply to this answer
One detail: PasswordAuthentication controls password-based SSH authentication, not every possible password prompt. Depending on the server configuration, keyboard-interactive authentication may also allow password-based access. If your goal is to require keys, review the effective authentication settings rather than relying on one line alone.
Reply to this answer
Add your answer
Answers are reviewed before publication.
w2+Clasp:
Got it. Iโll make sure a fresh SSH session works with the key before applying the change.