我在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
将.service
的radiusd
文件的内容放在您的帖子中是个好主意。