Use Userify to create corrected user accounts.
- Shut down your instance.
- Right click and choose "View/edit UserData script"
- Paste either the CloudInit or Shell Script deployments for Userify
- Paste your SSH Public key into your Userify Account
- Boot your instance
- Grant yourself root access by clicking "root" in Userify
- Wait 30 seconds and then log in and fix the problem.
The userdata script will install the Userify agent (shim) on your instance and create your user account (sudo-capable) so you can fix the issue. You'll also be able to update these user accounts anytime, remotely, or even remove them when you're not using them.
Note: if your user account that is already on the instance has the same username that you're using in Userify, Userify will not edit it or fix it since it's already on the instance and Userify leaves user accounts alone that it didn't create.
To fix this, you just need to log in with a temporary username instead. If you prefer to fix it so that Userify manages all of your accounts from now on, just log in (using the temporary user account) and delete your current user account. Once the current user account is gone, Userify will automatically create any missing accounts with the correct username.