I upgraded my dedicated server from ubuntu 11.1 to ubuntu 12.04. After the server upgrade says 'unable to initialize PAM: No such file or directory' when i am going to change the user to sudo. I got this solution which is saying to make the /etc/pam.d/common-session-noninteractive file manually.

But this thing cannot be done as i do not have the permission to change the super user. Can any one help on this.

  • 1
    Try pkexec dpkg-reconfigure sudo.
    – Danatela
    Mar 24 '14 at 3:31
  • @Danatela, But it seems pkexec is not installed the system, I cannot install is without the super user permission. It's like a deadlock. Mar 24 '14 at 9:05
  • No, just hold [Shift] during a boot, select recovery mode and drop to a root shell with networking. See the provided link for more detailed instruction.
    – Danatela
    Mar 24 '14 at 9:09

If the provided solution seems too complicated, there is another way:

  • Reboot the computer
  • Hold Shift during the boot
  • In the GRUB menu, choose `<your Ubuntu version> - recovery mode
  • Select Remount filesystem read/write
  • Choose Drop to root shell
  • Enter nano /etc/pam.d/common-session-noninteractive or vim /etc/pam.d/common-session-noninteractive

And you can always fix everything by booting from LiveCD/LiveUSB, unless you've encrypted your system.

  • And then what? I just exit the file just opened (in the last item of your list)?
    – DrHAL
    Oct 21 '18 at 6:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.