- This error can occur immediately after changing the user’s home directory by:
Command: sudo usermod -d var/www/html username
- For e.g: I have recreated the instances to use Amazon Linux instead of Ubuntu.
Now, I have to switch to use "EC2- user" as the username instead of "Unbuntu" to make sure that any error is not occurring.
- It can also occur due to lack of permission to the authorized_key file in ~/.ssh
The permission of this file should be 0600 and permission of ~/.ssh should be 700.