Monday, 21 March 2022

SSH still requires pwd after creating .ssh/authorized_keys file

https://www.ibm.com/docs/en/sia?topic=kbaula-enabling-rsa-key-based-authentication-unix-linux-operating-systems-3

  1. Enable key-based authentication in the /etc/ssh directory on the SSH server.
    1. Ensure that the following lines exist in the sshd_config file:
      # Should we allow Identity (SSH version 1) authentication?
      	RSAAuthentication yes
        
      	# Should we allow Pubkey (SSH version 2) authentication?
      	PubkeyAuthentication yes
              
      	# Where do we look for authorized public keys?
      # If it doesn't start with a slash, then it is
      # relative to the user's home directory
      AuthorizedKeysFile .ssh/authorized_keys
    2. Restart the SSH server. (sudo systemctl restart ssh https://askubuntu.com/questions/103889/how-do-i-restart-the-ssh-service)
  2. Make sure the permissions on the ~/.ssh directory and its contents are proper. (user and group should only be u, and permission for .ssh should be 700, authorized_keys should be 600) https://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication

No comments:

Post a Comment