Sudo, kind of, create "invalid" environment for "user". Here one example: (I am not sure is it related or is it wrong/bad) ---- root:~# mkdir tmp root:~# chmod 0 ./tmp root:~# ls -ld tmp d--------- 2 root root tmp root:~# cd tmp root:~/tmp# sudo -u user bash To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.
user:~/tmp$ ls ls: cannot open directory .: Permission denied user:~/tmp$ cd .. user:~$ ls tmp user:~$ cd tmp bash: cd: tmp: Permission denied ---- Example for one real case: 'sudo -u user filemanager' Note: If I am "admin" (not "root"), then I can't change current directory before 'sudo' - because "user" home could have limited permissions like this: drwx------ 2 root root /home/user -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/410022 Title: sudo doesn't propagate $PWD -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs