Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Has anyone ever encountered a scenario where you are logged into a system going about your standard business, cat, ls, tail, grep, vim, find etc. and suddenly permissions to regular things stop working? When I do a whoami it turns out I'm not my regular user but another user.

For example

bash>cat /dev/null > perm.mark
bash>tail -f perm.mark
bash>cat /dev/null > perm.mark
     permission denied

Any ideas about what's happening here?

share|improve this question

closed as too localized by rozcietrzewiacz, Renan, jasonwryan, warl0ck, Mat Sep 22 '12 at 14:54

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Can you include the /etc/passwd entries for both adam and mark and use the 'id' command instead of whoami? Also it isn't something like 'clear' is an alias for 'sudo -s adam' right? (maybe include output of 'set' or run through the commands after running 'set -x')? – polynomial Aug 29 '11 at 7:53
Hmm I think you may have hit upon something here, mark is not a user. Which means the account must be an alias of adam. Does that sound possible? – Mark D Aug 29 '11 at 13:25
You either hit some aliased command or have a seriously corrupted base system utilities. – rozcietrzewiacz Aug 29 '11 at 16:14
Just happened again. I'm betting the base system is pretty corrupt somehow, users not making it into the passwd file, other users suddenly changing through. There are other issues on the box too which is beyond the scope of this question. I'll recommend a re-install of the base... – Mark D Aug 29 '11 at 16:18
Do a memory test (available in many read-for-use forms, as packages for many Linux distributions, and included in the Ubuntu boot CD, SystemRescueCD and many other bootable diagnostic utility suites). – Gilles Aug 29 '11 at 22:26
up vote 1 down vote accepted

Turns out that this was a problem with the LDAP for the domain. The mark user was cloned from Adam, as a result he ended up with the same user id group id etc. etc. I tar'd the contents of mark's home directory. Then destroyed mark from the ldap server and created him again from scratch. Looks like it all works now.

share|improve this answer

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