last: /var/log/wtmp: No such file or directory 错误解决方法图文教程

今天在使用last 命令时出现了如下错误:

[email protected]:~# last
last: /var/log/wtmp: No such file or directory
Perhaps this file was removed by the operator to prevent logging last info.

显示没有这个文件,可能是之前清楚日志的时候连文件一起删除了。现在给出解决方案,在shell命令行里直接输入:

touch /var/log/wtmp ;?chown root:utmp /var/log/wtmp ;?chmod 0664 /var/log/wtmp

再次执行 last 命令,就正常了。

厂家CPU内存硬盘流量价格购买链接
RamNode11GB25GB-SSD500GB/mUSD $5购买
Linode11GB25GB-SSD1000GB/mUSD $5购买
DigitalOcean11GB25GB-SSD1000GB/mUSD $5/m购买
腾讯云Qcloud22GB50GB-SSD购买
Vultr11GB25GB-SSD1000GB/mUSD $5/m购买

Posted

in

by

Comments

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注