Search This Blog

2014-10-28

vnc xauth: timeout in locking authority file /home/user/.Xauthority

OS: CentOS 6.8

For some unknown reason when I setup VNC, I found following timeout warning when starting VNC. The commands pause for about 30 seconds prior of printing the warning. VNC seems to work, but I dislike the long pause, so I troubleshoot and solved the problem

-bash-4.1$ vncserver :2
xauth:  timeout in locking authority file /home/oracle/.Xauthority

New 'iccs2.rogers.com.my:2 (oracle)' desktop is iccs2.rogers.com.my:2

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/iccs2.rogers.com.my:2.log

The solution is as below

Checks audit log for issue

# tail -f /var/log/audit/audit.log
type=AVC msg=audit(1414515075.757:51357): avc:  denied  { write } for  pid=4590 comm="xauth" name="oracle" dev=dm-3 ino=12 scontext=unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1414515075.757:51357): arch=c000003e syscall=2 success=no exit=-13 a0=7fff35dc7f60 a1=c1 a2=180 a3=8 items=0 ppid=3707 pid=4590 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts1 ses=8452 comm="xauth" exe="/usr/bin/xauth" subj=unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023 key=(null)

This leads me to a known bug in RedHat below
https://bugzilla.redhat.com/show_bug.cgi?id=994752

Folowing command fix the problem
restorecon -R -v /home
[root@iccs2 audit]#  restorecon -R -v /home
restorecon reset /home/oracle context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_dir_t:s0
restorecon reset /home/oracle/.vnc/iccs2.guidewire.com:0.pid context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/.vnc/xstartup context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/.vnc/passwd context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/.gnome2/panel2.d/default context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gnome_home_t:s0
restorecon reset /home/oracle/.gnome2/panel2.d/default/launchers context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gnome_home_t:s0
restorecon reset /home/oracle/scchen/gc.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/scchen/cognos/cc705_cognos_sichen.dmp context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/scchen/b.txt context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/.local/share context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/Trash context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/Trash/info context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/Trash/info/VNC 1024.desktop.trashinfo context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/Trash/files context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/Trash/files/VNC 1024.desktop context unconfined_u:object_r:user_home_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/.converted-launchers context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/root context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/uuid-4e2249c7-2a94-41e5-b1ea-23ac20d6ad3c context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/home context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/home-a0f4bb81.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/root-e107fc3e.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/computer: context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/uuid-4e2249c7-2a94-41e5-b1ea-23ac20d6ad3c-5037733c.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/gvfs-metadata/computer:-e750142c.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/applications context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/applications/preferred-web-browser.desktop context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.local/share/applications/preferred-mail-reader.desktop context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:data_home_t:s0
restorecon reset /home/oracle/.gconf/desktop context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome/accessibility context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome/accessibility/keyboard context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome/accessibility/keyboard/%gconf.xml context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome/accessibility/%gconf.xml context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/gnome/%gconf.xml context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.gconf/desktop/%gconf.xml context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:gconf_home_t:s0
restorecon reset /home/oracle/.config/gnome-session/saved-session context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:config_home_t:s0
restorecon reset /home/oracle/script/db_backup.sh context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/script/afiedt.buf context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/script/db_backup.log context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:user_home_t:s0
restorecon reset /home/oracle/.dbus/session-bus context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:dbus_home_t:s0
restorecon reset /home/oracle/.dbus/session-bus/e7dac32006df225a8bda685e0000001a-0 context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:dbus_home_t:s0
restorecon reset /home/oracle/.dbus/session-bus/e7dac32006df225a8bda685e0000001a-1 context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:dbus_home_t:s0
restorecon reset /home/oracle/.dbus/session-bus/e7dac32006df225a8bda685e0000001a-2 context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:dbus_home_t:s0
restorecon reset /home/oracle/.pulse/e7dac32006df225a8bda685e0000001a-device-volumes.tdb context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:pulseaudio_home_t:s0
restorecon reset /home/oracle/.pulse/e7dac32006df225a8bda685e0000001a-card-database.tdb context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:pulseaudio_home_t:s0
restorecon reset /home/oracle/.pulse/e7dac32006df225a8bda685e0000001a-stream-volumes.tdb context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:pulseaudio_home_t:s0
restorecon reset /home/oracle/.pulse/e7dac32006df225a8bda685e0000001a-runtime context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:pulseaudio_home_t:s0


After completed above command, now starting vncserver is immediate, and no more warning message

Other possible error is current user doesn't has permission to create new file in home directory. Manually create a file to verify whether this is the root cause

touch /home/oracle/test1
rm /home/oracle/test1

If you can't create file, then use "chmod +w /home/oracle" to give the permission

If the file system is not EXT3/EXT4 and so on, but a read-only mount point, then ensure you re-mount it and give it write permission, or set variable HOME to a different directory where writing is possible

No comments:

Blog Archive