This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Unix, Xenix and ODT General FAQ

How can I tell if a user logged in locally, used rlogin, telnet or ssh?

You can use the concept here to back trace any process. This script will find the first ancestor process after init. This would be sshd or telnet or just a getty, etc.


Hate these ads?



   MYPROC=$$
   NEXTPROC=$MYPROC
   while [ $NEXTPROC != 1 ]
   do
   MYPROC=$NEXTPROC
   NEXTPROC=`ps -p $MYPROC -o "ppid=" `
   done
   ps -p $MYPROC -o args=


 


Fabio Gianotti observed:



Not to be picky, but on my system, the above script returns "/etc/inetd" if
you've used either telnet or rlogin , so I changed it slightly:








   echo $0 `tty` `id`
   INETPROC=`cat /etc/inetd.pid`
   MYPROC=$$
   NEXTPROC=$MYPROC
   while [ $NEXTPROC != 1 -a $NEXTPROC != $INETPROC ]
   do
   MYPROC=$NEXTPROC
   NEXTPROC=`ps -p $MYPROC -o "ppid=" `
   done
   ps -p $MYPROC -o args=








ad

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
51351,449 2,994

/SCOFAQ/FAQ_scotec6howlogged.html copyright 1997-2003 (various) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - FAQ
       - SSH




Unix/Linux Consultants


http://echo3.net/ Unix/Linux Custom Applications, Web Hosting, C/C++ Programming Courses


http://www.cleverminds.net Need expert advice? Want a second opinion? CleverMinds is a one-stop-shop for a wide range of technology solutions. We support Unix, Linux, SCO as well as CMS, ecom, blogs, podcasts, search engines consulting and more. Contact us at web2.0@cleverminds.net 0r (617) 894-1282


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at http://opensystemscomputing.com and www.go2unix.com.



Twitter
  • Nov 30 20:25
    I have 37,000 words of a 50,000 word project. I'd like to finish it this week..
  • Nov 30 20:05
    My wife made turkey sandwiches with stuffing and cranberry orange relish - I did not want to eat the last bite. Didn't want it to end!









Change Congress


Related Posts