linux密码验证模块
Tofloor
poster avatar
WPP2015
deepin
2015-01-27 04:47
Author
在linux下一些操作需要超级权限,需要输入密码,类似于安装软件时跳出对话框让我们输入密码,请问这个功能是怎么实现的?
Reply Favorite View the author
All Replies
MattD
deepin
2015-01-27 05:07
#1
policykit+gksu/gksudo。
Reply View the author
WPP2015
deepin
2015-01-27 16:46
#2
请问能直接调用这个模块吗。我现在在写一个程序,点击按钮时要求身份验证,然后执行一些需要root权限的操作。谢谢
Reply View the author
MattD
deepin
2015-01-27 18:16
#3
请问能直接调用这个模块吗。我现在在写一个程序,点击按钮时要求身份验证,然后执行一些需要root权限的操作。谢谢
这些API调用直接找官网看英文文档。
gksu:
https://wiki.gnome.org/action/sh ... p;redirect=gksu
http://www.nongnu.org/gksu/
polkit:
https://access.redhat.com/docume ... uide/policykit.html
http://www.freedesktop.org/software/polkit/docs/latest/
可以独立使用polkit,也可以把polkit与gksu/gksudo或kdesu/kdesudo结合使用。
Reply View the author