SUSE Support

Here When You Need Us

Users logging into the server with ssh are not recorded in lastlog

This document (7014881) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11

Situation

Message in /var/log/messages when someone tries to login via ssh.  The login works correctly and ssh allows the user in.  However the lastlog is not updated. This means that information about users' last logins are missing. 

Mar 22 02:00:26 linux-p3qt sshd[8372]: Accepted keyboard-interactive/pam for test from 172.16.176.1 port 50055 ssh2
Mar 22 02:00:26 linux-p3qt sshd[8372]: lastlog_filetype: Couldn't stat /var/log/lastlog: No such file or directory
Mar 22 02:00:26 linux-p3qt sshd[8372]: lastlog_openseek: /var/log/lastlog is not a file or directory!
Mar 22 02:00:26 linux-p3qt sshd[8372]: lastlog_filetype: Couldn't stat /var/log/lastlog: No such file or directory
Mar 22 02:00:26 linux-p3qt sshd[8372]: lastlog_openseek: /var/log/lastlog is not a file or directory!

Resolution

The lastlog file does not exist. Create the file with these commands: 
# touch /var/log/lastlog
# chgrp utmp /var/log/lastlog
# chmod 664 /var/log/lastlog

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7014881
  • Creation Date: 09-Apr-2014
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.