我在Google freeradius上安装了authenticator服务器,以提供基本的多因素设置。

当我以root身份在调试模式下运行radiusd时,一切正常。如果我将其作为服务启动,则登录失败,并且在处理消息时会记录以下消息:

radiusd(pam_google_authenticator)[1115]:无法读取“ user@domain.com”的“ /home/user@domain.com/.google_authenticator”

我认为这一定是一个权限问题,因为当以root身份运行时,它可以很好地工作。

我真的不想为每个用户编辑每个机密文件的权限。

我试过在指定root


  /etc/raddb/radiusd.conf
  
  用户=根组=根


但是,除非以root身份从命令行运行,否则该服务仍然会失败。有人对这个难题有一个很好的优雅解决方案吗?

最佳答案

我认为您应该检出radiusd的systemd服务文件。它可能看起来像:

https://github.com/ipfire/ipfire-3.x/blob/master/freeradius/systemd/freeradius.service

如果需要,可以在User=文件的Group=部分中添加[Service].service。看到

https://unix.stackexchange.com/questions/347358/how-to-change-service-user-in-centos-7



https://serverfault.com/questions/806617/configuring-systemd-service-to-run-with-root-access

.serviceradiusd文件的内容放在您的帖子中是个好主意。

10-08 13:38
查看更多