1

In my administrator account, from terminal I use the following command(mistakenly)

  1. gedit ~/.pam_environment
  2. PATH=/home/acer:$PATH
  3. Save and close the file.
  4. Restart the computer to initialize the new PATH variable.

After that, I can't open the account using earlier password. So can't install anything.

muru
  • 193,181
  • 53
  • 473
  • 722
BADAL
  • 11
  • 1

1 Answers1

2

~/.pam_environment isn't evaluated by a shell but by the pam_env PAM module. So you can't use shell syntax like $PATH there and your $PATH is now set to literally /home/acer:$PATH so programs in /bin/, /usr/bin/, ... aren't found.

Boot into recovery mode (see How do I boot into a root shell?) and edit or remove your .pam_environment.

Florian Diesch
  • 86,013
  • 17
  • 224
  • 214
  • I can't edit the .pam_environment during recovery mode booting? How can I do it? – BADAL Mar 13 '17 at 09:41
  • See [How do I change file system in recovery mode to read-write mode?](https://askubuntu.com/questions/117950/how-do-i-change-file-system-in-recovery-mode-to-read-write-mode) – Florian Diesch Mar 13 '17 at 10:17