1

I have a linux machine running Fedora 16 in a cupboard. It has no screen or keyboard. I connect to it using a combination of vnc and ssh.

Recently, after an update, I have had issues with authentication on the machine.

If I vnc to it, the kde desktop pops up an error dialog every few minutes saying Authorization failed. Failed to obtain authentication.

If I plug in a USB drive it fails to mount, Dolphin reports an authentication issue again.

I have had limited success finding the solution. AFAICT, it is an issue with ConsoleKit deeming me to be a non-local user so it prevents authentication.

This is the output from ck-list-sessions:

$ ck-list-sessions 
Session5:
        unix-user = '1000'
        realname = 'steve'
        seat = 'Seat6'
        session-type = ''
        active = FALSE
        x11-display = ':1'
        x11-display-device = ''
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2012-09-16T08:07:03.137011Z'
        login-session-id = '1'

I have tried to update my .vnc/xstartup script to include ck-launch-session as follows:

$ cat ~/.vnc/xstartup 
#!/bin/sh

exec ck-launch-session vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
export XKL_XMODMAP_DISABLE=1
OS=`uname -s`
if [ $OS = 'Linux' ]; then
  case "$WINDOWMANAGER" in
    *gnome*)
      if [ -e /etc/SuSE-release ]; then
        PATH=$PATH:/opt/gnome/bin
        export PATH
      fi
      ;;
  esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
  exec ck-launch-session /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
  exec ck-launch-session sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
exec ck-launch-session xsetroot -solid grey
exec ck-launch-session xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
exec ck-launch-session twm &

This has not helped.

How can I either authenticate myself to ConsoleKit, or trick it into believing I am a local user?

1 Answer 1

2

You are misunderstanding the way exec and ck-launch-session work.

  1. Every time ck-launch-session is used, it creates a new session. This means you can't just add it to every single line of your Xstartup – instead you must launch the entire Xstartup script with ck-launch-session.

    For example, you could rename the xsession script to xsession-real, then run it like this:

    exec ck-launch-session ~/.vnc/xsession-real
    
  2. Every time exec is used, it replaces the current process with the new one. If the script calls exec xsetroot, the rest of the script will not be executed. This means you must use it only for the final command.

    (Note: This does not apply when & is used. Both foo & and exec foo & are equivalent; they only replace the child process that & creates.)

    #!/bin/sh
    
    vncconfig -iconic &
    
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    export XKL_XMODMAP_DISABLE=1
    OS=`uname -s`
    if [ $OS = 'Linux' ]; then
      case "$WINDOWMANAGER" in
        *gnome*)
          if [ -e /etc/SuSE-release ]; then
            PATH=$PATH:/opt/gnome/bin
            export PATH
          fi
          ;;
      esac
    fi
    
    if [ -x /etc/X11/xinit/xinitrc ]; then
        exec /etc/X11/xinit/xinitrc
    elif [ -f /etc/X11/xinit/xinitrc ]; then
        exec sh /etc/X11/xinit/xinitrc
    fi
    
    [ -r ~/.Xresources ] &&
        xrdb ~/.Xresources
    xsetroot -solid grey
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    exec twm
    
2
  • thanks for the response, and for the great explanation on how these utilities work. I have done just what you suggested; running exec ck-launch-session ~/.vnc/xstartup.real &. If I launch vnc and then ps -ef it shows ck-launch-session running, but my vnc session is still not authenticated. ck-list-sessions still shows is-local=FALSE and active=FALSE Sep 17, 2012 at 9:55
  • is-local=FALSE is to be expected, because the session isn't local. As for active=... I don't even know how ConsoleKit determines activity. I remember it having great trouble with anything other than Xorg or tty... Sep 17, 2012 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .