个人工具

UbuntuHelp:DmrcErrors

来自Ubuntu中文

跳转至: 导航, 搜索

dmrcErrors

This page deals with .dmrc and $HOME permission error messages generated during session logins and how to correct the errors.

The Error Message

During a session log on, the following message is displayed. The user may continue to the Desktop after acknowledging the message.

 
User's $Home/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions. User's $Home directory must be owned by user and not writable by other users. 

dmrcErrors?action=AttachFile&do=get&target=dmrc_error.png

The Cause

During boot or session start, the system detected an error in the ownership and/or permissions of the $HOME folder or the ~/.dmrc file. You will still be able to gain access to your user account and have administrative (sudo) rights if you are in the admin group. The common cause of this error is an inappropriate use of the 'chown' or 'chmod' command, possibly combined with the '-R' option. The '-R' switch adds the recursive option to a command, meaning that the command is executed not only on the specific file or folder, but all subfolders and files below it. Be very careful whenever applying the -R switch to a command. If you don't need it, don't use it. An example of a command that would cause this to occur would be "chmod -R 777 /home/username" since this would both make the user's home folder writable by others and change the permissions of the .dmrc file to "777". Neither of these is acceptable by the system.

The Fix

The following commands will restore the ownership and permissions to those acceptable by the operating system. If you perform the commands in order, the use of 'sudo' is not required for the 'chmod' commands. If, for some reason, you are running the livecd (not necessary) and have booted to a root prompt, 'sudo' is not required for any command. Items in bold are portions of the generated error message. Replace all instances of username with your login name. . Open a terminal: In Hardy, using the menus, go to "Applications, Accessories, Terminal" , or ALT-F2, type gnome-terminal in the window, tick 'Run in terminal' and click on "RUN" or From the login screen, select Options from the lower left corner of the screen. Select Failsafe Terminal, enter your username and password, and enter the commands in this wiki into the terminal window that opens. . User's .dmrc file should be owned by user:

 
sudo chown username /home/username/.dmrc

Example for a user with a login of john: sudo chown john /home/john/.dmrc . and have 644 permissions:

 
chmod 644 /home/username/.dmrc

Note: If you look at the actual ~/.dmrc permissions, you will see that the system defaults to "644". If you view the permissions after logging back in, you will find the system has changed the permissions to "600" ( -rw------ ). You can substitute "600" in this command if you wish. . User's $HOME directory must be owned by user:

 
sudo chown username /home/username

Note: This command does not use the recursive -R switch. While all folders and files within the $HOME folder normally are owned by the user, the only folder which needs to have the ownership changed to eliminate this error is the $HOME folder itself. You may run this command as "sudo chown -R username:username /home/username" if you want to ensure the entire contents of your home folder belong to you and your usergroup. . and must not be writable by others:

 
chmod 755 /home/username

Other acceptable permissions include 750 or 700. note.

ls /home -l 
drwxr-xr-x 143 user   user    

is what you want to aim for. 'originally; I had something like drwxrwxrwxr user user I had set the permissions as 777 after reading about this i tried chmod 700 /home/username and logged out no problems but went to chmod 755 /home/username It's a pity that the .dmrc error message really is pretty useless as its rarely the real problem. . Log out and back in for the changes to take effect. Rebooting is not necessary.

The .dmrc File

The .dmrc is an initialization file which the system checks during session login. Specifically, gnome checks the file for any specific language or session information it hasn't located elsewhere. While often the file is blank except for the basic header data, it may contain a specific language to use at session startup. Below is an example. The plain text is the default entry, the bold text is what would be added to begin the session with a specific language.

.
[Desktop]
Session=gnome
Language=cs_CZ.UTF-8

Summary

Depending on the problem, all of these steps may not be necessary. Running all of them will correct any of the issues addressed by the error message. They can be run in terminal in the current session or from the root prompt in recovery mode. If running from the root prompt, sudo is not required. These commands will not work from the LiveCD Desktop without modification. Replace all instances of username with your login name.

.
sudo chown username:username /home/username/.dmrc
chmod 644 /home/username/.dmrc
sudo chown username:username /home/username 	
chmod 755 /home/username

Log out of your current session and back in. Rebooting is not necessary but will accomplish the same thing.

See Also

  • [[UbuntuHelp:dmrcErrors/../FilePermissions|FilePermissions]]

External Links