5

I'm using Xmonad as my window manager.

In the application nautilus, whenever I try to mount my usb sticks, it shows me the dialog "Not authorized to perform operation."

I have tried putting this in ~/.xsession file:

nautilus --no-desktop -n &

But that doesn't work.

This is my current ~/.xsession file:

#!/bin/bash

gnome-settings-daemon &
exec dbus-launch --exit-with-session xmonad

Also, when I start a pure gnome session, everything works fine. Any idea on how to make nautilus ask password or mount the usb stick on clicking it in the nautilus ?

5
  • Have you tried launching nautilus as root from a terminal?
    – bleeves
    Mar 15, 2014 at 6:37
  • @bleeves yes. But I want to use nautilus as a normal user. Security wise, opening nautilus is a bad practice.
    – Sibi
    Mar 15, 2014 at 6:53
  • ^ Opening nautilus as a root user is a bad practice.
    – Sibi
    Mar 16, 2014 at 11:53
  • Agreed. I was asking if he had tried sudo to ascertain the reason it was locked, not recommending an answer.
    – bleeves
    Mar 16, 2014 at 13:35
  • There must be a permission to be granted somewhere... I would not accept solutions that require root access or modifying fstab. It is most likely with polkit setup and again, I wouldn't like to modify the polkit rules. Mar 27, 2016 at 17:50

4 Answers 4

3
  1. Open Disks from Dash

    enter image description here

  2. Choose the desired disk/partition

    enter image description here

  3. Edit Mount Options

    enter image description here

  4. Uncheck require additional authorization

    enter image description here

1
1

You need to start polkit in your xsession.

You most likely have a .desktop file in /etc/xdg/autostart in the path somewhere with the full path to your polkit daemon.

For me adding /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 in ~/.Xsession fixed the issue.

0
0

You will have this error if using XRDP. You need to login directly to Xwindow from KVM.

0

This nice overview of polkit from archlinux wiki is very useful to understand the topic.

In my case, since I'm running a custom configured desktop composed of awesome, nodm, consolekit, and other hand picked software, I have to start a polkit authentication agent manually. This is provided by mate-polkit-bin package in debian. I believe xmonad will be a very similar case.

Before: thunar failing to mount, saying "Failed to mount XXX. Not authorized to perform operation."

After running mate-polkit: thunar upon attempt to mount asks me to authenticate according to the polkit rules for the given action. This is actually requested by the udisks tool that thunar uses to do the mounting. Once correctly authenticated, devices mount as expected.

Solution is to add a polkit authentication agent (like mate-polkit) to your session startup commands (autostart).

2
  • Do you know what polkit agent needs to be run on Unity or a gnome session in Ubuntu ?
    – Sibi
    Mar 27, 2016 at 19:25
  • I'm not sure, try examine apt-cache search polkit. I've seen somewhere, but cannot remember, that gnome session possibly has the agent built in. The mate package might work for you. See man pkcheck and try testing some admin action with the --allow-user-interaction parameter to see if you have things wired up. Mar 28, 2016 at 17:45

You must log in to answer this question.

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