Chinaunix首页 | 论坛 | 博客
  • 博客访问: 100546
  • 博文数量: 19
  • 博客积分: 1550
  • 博客等级: 上尉
  • 技术积分: 246
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-15 19:50
文章分类

全部博文(19)

文章存档

2013年(1)

2012年(4)

2010年(8)

2009年(6)

我的朋友

分类: LINUX

2010-05-02 23:38:10

sudo的-A选项是一个非常有用的选项,它可以使得sudo命令不需要每次输密码,它的作用原文如下:
Normally, if sudo requires a password, it will read it from
the current terminal.  If the -A (askpass) option is specified, a (possibly graphical) helper program is executed to read the user's password and output the
password to the standard output.  If the SUDO_ASKPASS environment variable is set, it specifies the path to the helper program.  Otherwise, the value specified by the
askpass option in sudoers(5) is used.

即通过指定一个helper proram用于提供密码
我只试过用第一种方法:
1.先写了个简单的C程序,只有一行:printf("密码\n");
\n必须要加。编译,获得可执行代码。
2.指定SUDO_ASKPASS为上面的可执行代码路径。
3.使用sudo命令,格式为:sudo -A XXXX

阅读(4852) | 评论(0) | 转发(0) |
0

上一篇:WinCE,pocketXpdf修改记录

下一篇:zone

给主人留下些什么吧!~~