1. 方法一:

Create the following file as root:

/etc/polkit-/rules.d/-nopasswd_global.rules

/* Allow members of the wheel group to execute any actions
 * without password authentication, similar to "sudo NOPASSWD:"
 */
polkit.addRule(function(action, subject) {
    if (subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});

Replace wheel by any group of your preference.

This will result in automatic authentication for any action requiring admin rights via Polkit. As such, be careful with the group you choose to give such rights to.

网址:https://wiki.archlinux.org/index.php/Polkit#Mounting_storage_without_password

2.方法二:

/etc/polkit-1/rules.d/allow-mount-internal.rules:

/* Copy this to /etc/polkit-1/rules.d/allow-mount-internal.rules */

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
         action.id == "org.freedesktop.udisks.filesystem-mount-system-internal") &&
        subject.local && subject.active && subject.isInGroup("users"))
    {
            return polkit.Result.YES;
    }
});

网址:https://gist.github.com/grawity/3886114#file-udisks2-allow-mount-internal-js

Linux & Systemd 挂载问题解决的更多相关文章

  1. Linux systemd资源控制初探

    Linux systemd资源控制初探 本文记录一次cgroup子目录丢失问题,并简单探索了Linux systemd的资源控制机制. 问题现象 我们希望通过systemd拉起服务并通过cgroup限 ...

  2. Linux 目录挂载服务

    Linux 服务器挂载文件目录通常有三种形式,手动挂载.自动挂载.Autofs 自动挂载,下面对这三个挂载做一下介绍,接受一下这三个区别以及使用场景: 准备服务器和客户端: server 192.16 ...

  3. linux上挂载windows共享文件夹

    linux上挂载windows共享文件夹 1.共享windows目录 挂载之前得创建一个有password的用户(当前用户也能够),并将你要挂载的目录进行共享,并赋予读写权限 如图. watermar ...

  4. Linux下挂载NTFS格式的U盘或硬盘

    我们知道在Linux下挂载fat32的U盘非常容易,使用mount /dev/drive_name /mnt/指定目录这样就可以挂载了,但是如果U盘或者硬盘的格式是NTFS的话,那么Linux是不能识 ...

  5. linux服务器挂载第二块磁盘图文解说

    文章来源:http://www.cndns.com/help/help_con.aspx?hid=394 Linux磁盘挂载是比较常见的管理操作之一.我司橙云预装的linux系统有2块盘,一块为系统盘 ...

  6. Linux systemd 打开调试终端、添加开机自运行程序

    /************************************************************************* * Linux systemd 打开调试终端.添加 ...

  7. linux修改挂载目录

    linux修改挂载目录   修改扩展磁盘默认的挂载点/home到/data   [root@localhost ~]# df -h 文件系统       容量  已用  可用 已用%% 挂载点 /de ...

  8. Aliyun上Linux服务器挂载数据盘及速度测试

    原始文档来自于阿里云官方文档:  Linux 系统挂载数据盘 铁锚 于 2013年12月19日 根据自己的需要进行整理 操作系统: CentOS 6.3, 平台  : 阿里云 ECS 云服务器 1. ...

  9. linux下挂载U盘

    转:http://www.cnblogs.com/yeahgis/archive/2012/04/05/2432779.html linux下挂载U盘 一.Linux挂载U盘: 1.插入u盘到计算机, ...

随机推荐

  1. jQuery插件之ajaxFileUpload异步上传

    介绍 AjaxFileUpload.js 是一个异步上传文件的jQuery插件,原理是创建隐藏的表单和iframe然后用JS去提交,获得返回值. 下载地址: http://files.cnblogs. ...

  2. easyui combotree的使用

    前台HTML: <div class="search-container"> <table class="search-container-table& ...

  3. jquery仿搜狐投票动画代码

    体验效果:http://hovertree.com/texiao/jquery/21/ 这是一款基于jquery实现的仿搜狐投票动画特效源码,运行该源码可见VS图标首先出现在中间位置,紧接着随着投票比 ...

  4. .NET基础架构方法—DataTableToList通用方法

    p { display: block; margin: 3px 0 0 0; } --> .NET架构基础方法—DataTableToList通用方法   我们经常需要将从数据库中所读取的数据以 ...

  5. HTML中嵌入pdf的简单方法

    <embed src="> 或者你不想显示某些功能的话: <embed src=">

  6. Eclipse中Python开发环境搭建

    Eclipse中Python开发环境搭建  目 录  1.背景介绍 2.Python安装 3.插件PyDev安装 4.测试Demo演示 一.背景介绍 Eclipse是一款基于Java的可扩展开发平台. ...

  7. Maven命令行使用:mvn clean compile(编译)

    先把命令行切换到Maven项目的根目录,比如:/d/xxxwork/java/maven-test,然后执行命令: mvn clean compile 执行结果如下: [INFO] Scanning ...

  8. VS 快捷键

    项目相关的快捷键 Ctrl + Shift + B = 生成项目 Ctrl + Alt + L = 显示Solution Explorer(解决方案资源管理器) Shift + Alt+ C = 添加 ...

  9. ASP.NET Core 运行原理剖析2:Startup 和 Middleware(中间件)

    ASP.NET Core 运行原理剖析2:Startup 和 Middleware(中间件) Startup Class 1.Startup Constructor(构造函数) 2.Configure ...

  10. 操作数数据类型 ntext 对于 max 运算符无效

    SoStyle.chi_description AS chi_description, SoStyle.description AS eng_description, SoStyle.chi_qual ...