金融其它 AIXvarwtmp

浅谈AIX /var/adm/wtmp

今天登陆系统时报如下错误
引用
telnet (mcsvr)

telnetd: failed to write to /var/adm/wtmp: A file or directory in the path name does not exist.

登陆系统时发现wtmp已经被人为删除了(删除那个人也太暴力了,哎),手工touch一个,错误消失,于是花了一点时间研究了wtmp的用处。
可以用strings查看wtmp内容,可以看到包含了登陆信息和crontab信息,试想一下,如果crontab经常出问题,wtmp势必会非常大。
引用
#errlog
cron
#errlog
cron
#errlog
cron
root
pts/0
pts/0
172.16.4.168
#errlog
cron
#errlog

通过last命令可以格式化查看用户登陆信息
引用
# last -f /var/adm/wtmp -n 100
root      pts/0        172.16.4.168           Dec 11 18:42   still logged in.
root      pts/1        172.16.4.137           Dec 11 18:39 - 18:40  (00:00)
root      pts/0        172.16.4.168           Dec 11 18:33 - 18:42  (00:09)
root      pts/0        172.16.4.168           Dec 11 18:26 - 18:32  (00:06)

wtmp begins     Dec 11 18:26


当然也可以通过who命令查看
引用
#  who -u /var/adm/wtmp
root        pts/0       Dec 11 18:26     0:01     33484  (172.16.4.168)
root        pts/0       Dec 11 18:33      .       33486  (172.16.4.168)
root        pts/1       Dec 11 18:39     0:09     35234  (172.16.4.137)
root        pts/0       Dec 11 18:42      .       51378  (172.16.4.168)


需要注意的是如果wtmp文件太大,用>/var/adm/wtmp清空即可。
参与8

提问者

yinxin
系统管理员 银信长远
擅长领域: 服务器存储虚拟化
评论530

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2010-12-14
  • 关注会员:0 人
  • 问题浏览:13511
  • 最近回答:2012-06-21
  • X社区推广