From owner-freebsd-questions Sun Nov 11 9:40:59 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail5.carolina.rr.com (fe5.southeast.rr.com [24.93.67.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A1B137B417 for ; Sun, 11 Nov 2001 09:40:51 -0800 (PST) Received: from snafu.enterit.com ([66.57.159.198]) by mail5.carolina.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Sun, 11 Nov 2001 12:40:34 -0500 Message-Id: <5.1.0.14.0.20011111125515.01eeebe8@mail.enterit.com> X-Sender: jconner@enterit.com@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 11 Nov 2001 13:04:33 -0500 To: Bsd Neophyte From: Jim Conner Subject: RE: how to get the IP address of someone logging into the server on the console Cc: project10 , Wade Majors , freebsd-questions@FreeBSD.ORG In-Reply-To: <20011111131351.59539.qmail@web20109.mail.yahoo.com> References: <20011111055554.J95500-100000@alpha.focalnetworks.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 05:13 11.11.2001 -0800, Bsd Neophyte wrote: >Hmmm... I wasn't too clear... and if I was clear and you are talking about >what i'm talking about... I applogize. > >I don't want the information when I log onto my FreeBSD machine. I want >the information to popup on my screen when anyone tries to login. You're talking about syslogd. Syslogd puts that information on the screen. Sshd gives that information to syslogd to log. Syslogd is configured on your machine so that anything calling the facility:level that sshd is calling that info gets sent to /dev/console. In order to change this, you would most likely be better off changing the source in sshd to send the ip address along with the information it currently sends. I suppose that what you are aiming for here is to be able to not only have logged who is coming from where but to have ready access (the terminal) to who is coming from where. >Alright... this is what my screen looks like right now after I used putty >to logon from my Win2k box. > >---------- > >FreeBSD/i386 (hostname) (ttyv0) > >login: > >login Nov 9 20:58:20 (hostname) su: sameer to root on /dev/ttyp0 > > >FreeBSD/i386 (hostname) (ttyv0) > >login: > > >--------- > >In addition to all this, I want the screen to give the IP address that I >used to logon... and I want it to tell me when I disconnected. As for disconnections, you could just make sure that the shells your users use read $HOME/.logout. Make those root owned and chmod 0644. In the .logout files, perform a logger: /usr/bin/logger -t $LOGNAME -p auth.notice "logged out!" the facility.level for my system to log things to /dev/console (pertaining to sshd) is auth.notice. I suspect yours is probably similar since my /etc/syslogd is still vanilla. That would probably be the quickest solution for the logout part. - Jim >Any ideas? > >-Sameer > > >--- project10 wrote: > > That would be logged in the file /var/log/wtmp* -- current login > > information is in /var/run/utmp. > > > > Sameer, what you want to do depends on how you are logging in -- sshd > > doesn't call login(1) (is this accurate? I'm guessing, here.) and as > > such > > won't produce similar messages to say, a telnet login. > > > > However, on my system, both sshd and telnet log originating IP: > > > > Nov 11 05:48:20 omega sshd[2215]: Accepted password for project10 from > > #host# port 21034 ssh2 > > Nov 11 05:49:00 omega login: login from #host# on ttyp2 > > as project10 > > > > Don't ask me how I got them to do that. I believe sshd does that > > automagically. > > > > --------- > > Shawn Lussier > > > > On Sun, 11 Nov 2001, Wade Majors wrote: > > > > > Last login: Sun Nov 11 03:43:14 2001 from ezri.ezri.org <==== > > > Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 > > > The Regents of the University of California. All rights > > > reserved. > > > FreeBSD 4.4-STABLE (METIS) #3: Mon Nov 5 00:05:44 EST 2001 > > > > > > > > > When I log into my machine I get the above message. Don't ask me where > > > that's logged, though. > > > > > > -Wade > > > > > >__________________________________________________ >Do You Yahoo!? >Find a job, post your resume. >http://careers.yahoo.com > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message - Jim -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861 -----BEGIN PERL GEEK CODE BLOCK----- ------BEGIN GEEK CODE BLOCK------ Version: 0.01 Version: 3.12 P++>*@$c?P6?R+++>++++@$M GIT/CM/J d++(--) s++:++ a- >++++$O!MA->++++E!> PU-->+++BD C++++(+) UB++++$L++++$S++++$ $C-@D!>++++(-)$S++++@$X?WP+>++++MO!>+++ P++(+)>+++++ L+++(++++)>+++++$ !E* +PP+++>++++n-CO?PO!o >++++G W++(+++) N+ o !K w--- PS---(-)@ PE >*(!)$A-->++++@$Ee---(-)Ev++uL++>*@$uB+ Y+>+++ PGP t+(+++)>+++@ 5- X++ R@ >*@$uS+>*@$uH+uo+w-@$m! tv+ b? DI-(+++) D+++(++) G(++++) ------END PERL GEEK CODE BLOCK------ ------END GEEK CODE BLOCK------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message