![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
In my SCO Unixware system I have command like last. Try something like
last | grep <your_name>| awk ' {print $3}' |
|
#11
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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.
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
|
|||
|
|||
|
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 |
| Tags |
| export display, linux |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|