"Authentication is required to update SMART data from" in 16.04

I upgraded to 16.04 [Ubuntu Gnome]. I am using a Lenovo Y700 with a GTX960M.

After suspend or closing the lid I ended locked outside the login after that message appeared. It happened twice today, I suspect the problem arises when closing the lid, not when using the suspend button hitting alt button while hitting the power button onscreen. Using open source NVIDIA version 364.19 nvidia-364.


Solution 1:

It's caused by lm-sensors. Click on the thermometer indicator (which is lm-sensors) -> Preferences -> Providers. Then untick 'Enable support of udisks2'. That seems to make it go away. (Source)

screenshot

Solution 2:

Original here: https://ubuntuforums.org/showthread.php?t=2274234&page=2&p=13522130#post13522130

this is caused by PolKit, and if you do want the sensors, you can write a custom rule:

sudo mkdir -p /etc/polkit-1/rules.d
sudo touch /etc/polkit-1/rules.d/00_user_hacks.rules

The file is actually JavaScript, which makes it pretty easy to modify if you have that experience.

const CUSTOM_PERMISSIONS = {
    // fixes udisk2 issue with lm-sensor where it prompts for root password after suspend -> resume
    "org.freedesktop.udisks2.ata-smart-update": polkit.Result.YES
};

polkit.addRule(function (action, subject) {
    if (subject.user == "YOUR_USERNAME_HERE" && action.id in CUSTOM_PERMISSIONS) {
        return CUSTOM_PERMISSIONS[action.id];
    }

    return polkit.Result.NOT_HANDLED;
});

You can just add other custom rules into the CUSTOM_PERMISSIONS object and it will be handled.