nvidi-361 login loop ubuntu 16.04 lts
Solution 1:
I solved this problem. This problem was caused due to secure boot and EFI_SECURE_BOOT_SIG_ENFORCE in linux kernel 4.4.0-20 and later.
I installed the nvidia-364 drivers and entered the key when asked. Then i rebooted the system. when blue screen of mok management appeared i pressed any key to changed it. Then it asked for password characters. then it let me to disable it. i reinstalled the nvidia 364 after booting in insecure mode. and it worked like charm.
You may not need to do all the steps. Some people are saying you only need to disable the validation by running
sudo apt install mokutil
sudo mokutil --disable-validation
I did not try this because my problem was already solved.
Many people are not able to install virtual box modules due to the same implementation of EFI_SECURE_BOOT_SIG_ENFORCE.
You don't need to move ./.Xauthority file or change permissions of /tmp folder or do any another workarounds if you are affected by the same issue.As many people are saying these work arounds.
You can read here in detail https://wiki.ubuntu.com/SecurityTeam/SecureBoot.