The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Six Twitter clients for the Linux desktop and one for the road iBot UNIX and Linux RSS News 0 04-29-2008 01:30 PM
login in red hat linux asutoshch Linux 3 04-02-2008 11:45 PM
Linux clients for three top P2P networks iBot UNIX and Linux RSS News 0 03-20-2008 01:40 AM
how to find out unix server details thopputhurai Filesystems, Disks and Memory 4 04-23-2007 03:16 AM
Map Drive from UNIX Server to Windows Clients kafaween UNIX for Dummies Questions & Answers 3 09-12-2006 07:37 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 07-05-2001
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,493
You might consider setting the local users HOSTNAME environmental variable to their IP address. When they log in remotely the DISPLAY variable willl be set using HOSTNAME (which will now be the IP address). When they execute an X process it will work because the IP address is in the DISPLAY variable and not the name. This eliminates the DNS problem.

This works, of course:

export DISPLAY=111.222.333.444:0.0

(without the name )
Forum Sponsor
  #9  
Old 09-04-2001
nitin's Avatar
Registered User
 

Join Date: Aug 2001
Location: Toronto, ON
Posts: 56
What it's equivalent in Digi Unix?

I tried to use netstat -n -e , but it gives me illegal option thingy. It so happens that Digi Unix doesn't have -e option with netstat. What is -e for? I think in order to find the IP of the user logged in one can pipe the users from who to netstat... Maybe that will work!
-Nitin
  #10  
Old 09-04-2001
Registered User
 

Join Date: Aug 2001
Location: Minsk,Belarus
Posts: 10
In my SCO Unixware system I have command like last. Try something like
last | grep <your_name>| awk ' {print $3}'
  #11  
Old 09-04-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
well, I have found one way to determine it by loking up host tables.
This is the script I am now using:
Code:
TTY=`who am i | awk '{ print $2 }'`
HOSTNAME=`w | grep $TTY | awk '{ print $3 }'`
IP=`host $HOSTNAME | awk '{ print $4 }'`
echo $IP
__________________
regards,

-ghoti
  #12  
Old 09-16-2001
Registered User
 

Join Date: Sep 2001
Location: CHENNAI, INDIA
Posts: 15
Unhappy

Hi,

I have the same issue, it seems that the second line of ur script gives the time. Can u tell me the exact working of this script?

Also, is it possible to find who is logged on in the remote machine?

Thanks,
__________________
K a n d a n
  #13  
Old 09-17-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
This script works as follows:
Code:
TTY=`who am i | awk '{ print $2 }'`
# TTY is second field of my "who am i" command

HOSTNAME=`w | grep $TTY | awk '{ print $3 }'`
#HOSTNAME is then the third field of the "w" command
#Which is the Hostname of the machine logged in FROM.

IP=`host $HOSTNAME | awk '{ print $4 }'`
#IP is then the IP number of the machine that made the 
#connection, looked up from the host tables.
#for me this is the fourth field.


echo $IP
#Print IP number to screen.
You may need to change some of the awk commands to different fields, as these are only what works on my system, Redhat 7.0.
try running it manually, line by line to find out what changes need to be made.

regards,
-gHoTi
__________________
regards,

-ghoti

Last edited by ghoti; 09-17-2001 at 04:41 AM.
  #14  
Old 09-17-2001
Registered User
 

Join Date: Sep 2001
Location: CHENNAI, INDIA
Posts: 15
Hi,
Thanks for the explanation.

But these things dont work for a Solaris/HP/AIX box.

The idea of passing the DISPLAY variable is good, we can know the IP Address.

Is it possible to pass the LOGNAME variable? I also need to find the user logged in the other machine. I tried exporting LOGNAME variable, as I do with DISPLAY, but it doesnt work. Unix gurus can u tell me what i should do?

Thanks
__________________
K a n d a n
Google The UNIX and Linux Forums
Closed Thread

Tags
export display, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0