Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
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.
When I do a last grep on user jdoe, I get:
jdoe pts/1 localhost Mon Aug 2 10:20 - 10:20 (00:00)
jdoe sshd localhost Mon Aug 2 10:20 - 10:20 (00:00)
jdoe pts/6 67.16.1.10.trm0 Mon Aug 2 10:14 - 10:20 (00:05)
jdoe sshd 67.16.1.10.trm0 Mon Aug 2 10:14 - 10:20 (00:05)
It seems the bottom 2 lines show the IP address where the connection was made from.
The top 2 lines says "localhost". What does that mean? It's not saying it logged on locally to the console right?
It doesn't mean the user logged on from the physical console right?
Would ssh'ing into the server remotely produce the same log?
This is the other part of the log:
Accepted keyboard-interactive for jdoe from 67.16.1.10 port 50752 ssh2
messages.005:Aug 2 10:20:20 server.domain.com sshd[29202]: [ID 900126 auth.info] Accepted keyboard-interactive for jdoe from 127.0.0.1 port 57521 ssh2
When I log in locally to my boxes (Slackware) I get tty1 (or whatever tty it was) and the host field is empty. If I use last -a -d I get 0.0.0.0 for the host.
The only time I see values like 127.0.0.1 for the connecting host when I'm not actually locally signing in is when I use NX over an SSH tunnel. In that case, I get an entry for last showing my remote IP addres as I'd expect, but in /var/log/messages I get something like this:
Code:
Oct 13 08:36:36 zaphod sshd[24561]: Accepted publickey for nx from 127.0.0.1 port 42308 ssh2
Were you running any programs over an SSH tunnel when those entries occurred?
I'm not sure since that wasn't me but another user...
When I do last, other users don't have an entry of localhost but only that particular user does.
When you do NX over ssh, does it log as "localhost" when using last command and in var/log/messages as 127.0.0.1?
I went back and matched up time stamps from remotely connecting via SSH and using NX with the output from last. There are no localhost messages as you describe. I also haven't been able to force a hostname of localhost by connecting locally.
It could be differences in the versions of utilities between Ubuntu and Slackware unless someone else has jdoe's credentials and may have used them locally. That doesn't seem likely given that the timestamps follow on from each other.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.