LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-01-2003, 12:37 AM   #1
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Rep: Reputation: 15
Angry Login message lost...


Hi all,

Usually, when I login to a RedHat box, locally or remotely,there comes out a
message like "Last login: Sun Jun 29 14:57:58 2003 from *.*.*.*". But these
days I found some of our RedHat 7.2 servers lost this message. When I login
to these boxes, I will directly see the command prompt like "[root@svr1
root]# ".
I guess maybe some configuration file was modified. Please help me out.
Any help will be appreciated.
 
Old 07-01-2003, 06:49 AM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Check and see if file /var/log/wtmp exists and what the permissions are.
Try command
last
which will read this file that stores the login session related info.
 
Old 07-01-2003, 08:00 AM   #3
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Original Poster
Rep: Reputation: 15
Hi nxny,

That's not what I mean...
I know /var/log/wtmp is responsibile for "last" command to show the login record. But what I mean is the message displayed when you login to a pts or tty. Please read my question instead of just my title.
Sorry for the misleading title...
 
Old 07-01-2003, 06:20 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
My point is that the 'Last Login:' information comes from /var/log/wtmp. Since it ain't plaintext , I would use command 'last' to display the contents of the file in a meaningful way. If there is no source of information, it is likely that the message would be displayed at all. On the other hand, if there is indeed a wtmp and your message is still not being displayed, there is something else that's causing this. So first things first, do you have a root-readable-writeable wtmp?
 
Old 07-01-2003, 11:13 PM   #5
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Original Poster
Rep: Reputation: 15
Hi,

Please take a look at the following lines. I copy the text from the very beginning of my login.
----------------------------
[root@svr1 root]# last
root pts/2 branch-2-h130.st Wed Jul 2 10:52 still logged in
root pts/2 branch-2-h131.st Tue Jul 1 10:14 - 10:26 (00:11)
root pts/2 branch-2-h131.st Tue Jul 1 09:58 - 10:14 (00:15)
root pts/2 61.171.248.178 Mon Jun 30 19:18 - 19:23 (00:04)
root pts/2 61.171.249.177 Sun Jun 29 14:14 - 15:02 (00:47)
root pts/2 61.171.118.18 Fri Jun 27 20:17 - 20:17 (00:00)

wtmp begins Fri Jun 27 20:17:15 2003
[root@svr1 root]# ll /var/log/wtmp
-rw-rw-r-- 1 root utmp 4608 Jul 2 10:52 /var/log/wtmp
[root@svr1 root]#
---------------------------
 
Old 07-03-2003, 05:58 AM   #6
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Original Poster
Rep: Reputation: 15
Hi,

Can anyone help me out?
 
Old 07-03-2003, 06:17 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
*First, regardless of whatever precautions you took, restrictions you set up or network layout, logging in as root is a bad thing to do. The responsable way is to login as user and sudo to root.

Two thinks to check: last login is read from /var/log/lastlog (root.root 0640) but readout will be suppressed when ~/.hushlogin exists.
 
Old 07-03-2003, 02:16 PM   #8
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
lastlog!! that is a definitely great insight, unspawn.

yuzuo.. Are you remoting in via telnet or SSH ? If you're using SSH, it is unlikely that you may see the last login message, because AFAIK, ssh is linked against the PAM libraries directly to perform authentication ( as opposed to invoking /bin/login, which reads lastlog )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setup system Login banner and Login message 06-03-05 Linux - Newbie 13 07-24-2020 03:05 PM
Kmail - some message contents lost doublej Linux - Software 1 10-20-2005 09:46 AM
lost interupt message on boot up efi360 Linux - Newbie 2 08-16-2004 03:09 PM
Lost login joelwnelson Red Hat 1 04-23-2004 11:14 PM
hd-problem files lost, strange e2fsck message inge_ninge Linux - Newbie 3 01-26-2003 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration