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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-01-2003, 12:37 AM
|
#1
|
Member
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81
Rep:
|
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.
|
|
|
07-01-2003, 06:49 AM
|
#2
|
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:
|
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.
|
|
|
07-01-2003, 08:00 AM
|
#3
|
Member
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81
Original Poster
Rep:
|
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...
|
|
|
07-01-2003, 06:20 PM
|
#4
|
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:
|
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?
|
|
|
07-01-2003, 11:13 PM
|
#5
|
Member
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81
Original Poster
Rep:
|
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]#
---------------------------
|
|
|
07-03-2003, 05:58 AM
|
#6
|
Member
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81
Original Poster
Rep:
|
Hi,
Can anyone help me out?
|
|
|
07-03-2003, 06:17 AM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
*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.
|
|
|
07-03-2003, 02:16 PM
|
#8
|
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:
|
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 )
|
|
|
All times are GMT -5. The time now is 07:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|