zoukankan      html  css  js  c++  java
  • Authentication token is no longer valid

    Linux: Authentication token is no longer valid

    Problem:
    Authentication token is no longer valid; new one required
    You (zabbix) are not allowed to access to (crontab) because of pam configuration.

    PAM Configuration

    The /etc/pam.d/ directory contain the PAM configuration files for each PAM-aware application.Each service has file in the /etc/pam.d which has the same name as the service.

    For Instance, the crond service pam file is below:

    1. [/etc/pam.d]$more crond
    2. #
    3. # The PAM configuration file for the cron daemon
    4. #
    5. #
    6. # No PAM authentication called, auth modules not needed
    7. account required pam_access.so
    8. account include password-auth
    9. session required pam_loginuid.so
    10. session include password-auth
    11. auth include password-auth

    PAM Configuration File Format

    Module_interface control_flag module_name module_argument

    1. account required pam_access.so
    2. account include password-auth
    3. session required pam_loginuid.so
    4. session include password-auth
    5. auth include password-auth

    Module_interface:
    auth: This module interface authenticates use. For example, it request and verifies the validity of a password.
    account: This module interface verified whether the access is allowed. For example, it check if a user account has expired of if a user is allowed to log in at a partical time of day.
    password: This module interfce is used to changing user passwords.
    session:This module interface configure and manager user sessions.

    PAN Control Flag

    required:The module result must be successful for authentication to continue. If the test fails at this point, the users will not be notified.
    requisite:Unlike required,if the test fails, the user will be notified immediately with a message reflectin the first failed required or requisite module test.
    optional:The result is ignored.
    include:Unlike the other controls,it does not relate to how the module result is handled.

    Solution

    Because the crond service must authenticate the user’s password.
    So we can check the user password information:

    1. chage -l username
    2. Last password change : May 05, 2016
    3. Password expires : Nov 01, 2016
    4. Password inactive : never
    5. Account expires : never
    6. Minimum number of days between password change : 0
    7. Maximum number of days between password change : 180
    8. Number of days of warning before password expires : 30

    If you find the password has expired, you can change the password and set the maxdays to 9999.

    1. password username:
    2. Command : chage -M 9999 username

    After that ,you can check if the file /etc/shadow has updated the maxdays for the specified user.Just like this:

    1. username:$6$EZ2LtFaZ$l6cUrKMIYW..37AStpjDYlal215FZg3NoKM0SgsUClsllKjVwkxsR4lFtWbNGvaGZkGwi5orqWziDMpfGGhvh/:17107:0:9999:30:::

    After all, it will be ok.





  • 相关阅读:
    Python_字典
    Python_字符串方法
    跳转到新页面,加载过程中加入等待过渡的动态效果
    web项目引入第三方jar包,编译时找不到的问题与及解决方案
    Eclipse的debug按钮介绍
    什么是TCP粘包?怎么解决TCP粘包问题?UDP协议存在粘包问题吗?
    使用Java编写TCP协议发送和接收数据接口
    UUID生成唯一的16位随机数
    如何在父页面中操作/获取iframe页面中的元素?这个小问题折腾了我快半个小时,所以记下来吧!
    如何接收APP的请求,并且如何以json字符串的格式封装响应的数据,然后发送回APP
  • 原文地址:https://www.cnblogs.com/roni/p/6022637.html
Copyright © 2011-2022 走看看