Hello Dino
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
The Microsoft.Azure.ActiveDirectory.AADSSHLoginForLinux extension is designed to allow users to log in to Linux VMs using their Azure AD credentials, but it does not restrict users from adding their public SSH keys to the authorized_keys file on the VM.
To prevent public key login, disable SSH password authentication on the Linux VM.
You can edit the '/etc / ssh / sshd_config" file and set PasswordAuthentication no
Once this file is modified then try to save the file. Restart the SSH service sudo systemctl restart ssh
To remove a user's home directory after login permissions have been revoked, you can delete the user's account from the Azure Active Directory.
Hope this helps.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.