美文网首页
解决“sudo: 账户过期,或 PAM 配置缺少 sudo 使用

解决“sudo: 账户过期,或 PAM 配置缺少 sudo 使用

作者: 有事找叮当 | 来源:发表于2024-07-21 14:11 被阅读0次

问题:以root身份在普通用户创建文件时出现账户过期

[anan@localhost ~]$ sudo touch a.txt
[sudo] anan 的密码:
sudo: 账户过期,或 PAM 配置缺少 sudo 使用的“account”节,联系您的系统管理员

解决办法:将用户过期时间改为此时此刻的后几个月/年 或者设置永不过期

[root@localhost anan]# usermod -e 2024/6/12 anan

成功后:

[anan@localhost ~]sudo touch a.txt [sudo] anan 的密码: [anan@localhost ~] ll
总用量 0
-rw-r--r--. 1 root root 0 5月 13 23:57 a.txt

相关文章

网友评论

      本文标题:解决“sudo: 账户过期,或 PAM 配置缺少 sudo 使用

      本文链接:https://www.haomeiwen.com/subject/dtwshjtx.html