I have written a simple application to authenticate user using PAM the common way: pam_start(), pam_authenticate() + my own conversation function + pam_end().

我编写了一个简单的应用程序来使用PAM以常见的方式验证用户:pam_start(),pam_authenticate()+我自己的会话函数+ pam_end()。

If application is run under the user who's credentials are being checked, authentication is succeeded. Otherwise, if application is run from user A to check credentials of user B, the authentication is failed. (

如果应用程序在正在检查凭据的用户下运行,则验证成功。否则,如果从用户A运行应用程序以检查用户B的凭据,则身份验证失败。 (

My question: why? As a service name passed to pam_start() I have tried also login as well as passwd. Nothing has changed. Which direction to go to debug the problem? Or possibly I should use another pam service to perform the task?

我的问题:为什么?作为传递给pam_start()的服务名称,我尝试过登录以及passwd。什么也没有变。调试问题的方向是哪个?或者我可能应该使用另一个pam服务来执行任务?

p.s. user 'A' in the second case is a user with no password and /bin/false shell.

附:第二种情况下的用户'A'是没有密码的用户和/ bin / false shell。

2 个解决方案

#1


0

How are you checking the "credentials"? Is it some file being read? Can user A read that file?

你是如何检查“凭证”的?是否正在读取某个文件?用户A可以读取该文件吗?

Service name passed to pam_start does not affect what the process can do. Note that programs that need to do similar things, like su or passwd are actually setuid programs.

传递给pam_start的服务名称不会影响进程可以执行的操作。请注意,需要执行类似操作的程序(如su或passwd)实际上是setuid程序。

Also, watch out not to create security holes in your application/module by allowing user A to impersonate user B.

另外,通过允许用户A模仿用户B,注意不要在应用程序/模块中创建安全漏洞。

更多相关文章

  1. Linux服务器权限管理实践——添加用户只访问某些文件目录
  2. 在Linux中的脚本中安装应用程序
  3. 如何发送一个字节(或字节)来测试在我的应用程序中监听的套接字?
  4. 关于使用samba用户的权限设置
  5. 〖Linux〗使用Qt5.2.0开发Android的NDK应用程序
  6. Shell脚本创建linux用户帐户但密码出错
  7. Linux 批量添加和删除用户
  8. Linux中的文件权限和用户组
  9. 添用户报错:useradd:警告:此主目录已经存在

随机推荐

  1. 在 HTML 中包含资源的新思路[每日前端夜
  2. Java后端开发三年多线程你都懂,问你异步编
  3. 把 WebAssembly 用于提升速度和代码重用[
  4. VS中scanf等函数报错解决方法
  5. 怎样用 JavaScript 操作 Cookie[每日前端
  6. 一招搞定GitHub下载加速!
  7. Javascript 的新功能-Part 1[每日前端夜
  8. 输入一个整数减去6的结果
  9. 对不起我拖后腿了!我才刚用上Java 11
  10. 求长方形面积