Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

There's been more than one occasion where something has gone with system because all the sudden there were permision changes to certain key files (sometimes taking a long time to find which file is the culprit) becomes -rw-------. Once I do a chmod 777 filename, then everything appears to be fine.

For example, I was trying to Install vncserver on an Ubuntu machine. For whatever reason, vncserver failed to start so I rebooted the machine and then. Then I was unable to log into Xcfe session because the /home/user/.Xauthority was file -rw------- instead of -rwxrwxrwx. Did chmod 777 /home/user/.Xauthority and it corrected my issue.

This wasn't the only time I've experience something along these lines. So my question is, what cuases this to happen? Do I need to be watch as to what install?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

What causes a file to lose permissions is either a program changing the permissions (rare) or a program recreating a new file with the same name and different permissions. The latter is what is happening here.

The .Xauthority file is maintained through the xauth utility. Whenever xauth changes the file, it first creates a new version, then moves it into place. This avoids having a malformed half-written file if xauth fails in the middle for any reason (disk full, power failure, …).

The .Xauthority file is always (re-)created with mode 006 (only accessible to the owner, with read and write permissions, i.e. rw-------) because these are the permissions that make sense for the file. The file contains confidential data, so it must not be accessible to other users. The file isn't executable, so it doesn't have any execute permission.

Whatever problem you're trying to solve, you're doing it wrong. The permissions 777 on .Xauthority are nonsensical. In most common situations, .Xauthority will have the correct data automatically. Occasionally, you might need to copy permissions from one cookie file to another with xauth merge, sometimes preceded by xauth extract. I suggest that you ask a question to find out what you should be doing instead; be sure to describe your problem precisely.

To summarize: in this case, your permissions don't stick because they don't make sense so the program that normally manipulates the file doesn't bother to replicate them.

share|improve this answer
    
Well I have asked, I didn't didn't get a response! lol Thank you for the insight tho! askubuntu.com/questions/153345/… –  hydroparadise Jun 24 '12 at 1:48
add comment

It's hard to say without knowing all the specifics, but sometimes the culprit will be some installation program setting permissions to something it thinks it needs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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