Quote:
Originally Posted by vijirin
I am connecting to linux server(RHEL4.7) using putty from my windows machine. Is there any way to get the ip address of my windows machine using C program in linux.
|
I just looked back at your original post. I'm confused.
This is what I'm envisioning after rereading the OP:
Windows with putty-------------ssh>>----------------->Linux
Machine<-------------<<ping--------------------------Machine
You say that you are connecting to the Linux box
FROM the Windows machine via putty and want the
ip address of the Windows machine that you are sshing
FROM, since that's the only Windows machine in the story.
If you want the ip address of your
Windows machine, ssh won't help you. Open a command window on the Windows windows machine and run the command
ipconfig /all. That's IPconfig, not IFconfig. That will tell you the ip address and the gateway and lots of other stuff for the Windows machine.
From your ssh connection, you could try telling the Linux box to ping back at your Windows box and see what happens.
You could try a traceroute from your local Windows box to the remote Linux box to see how many hops are involved.
If your Windows machine is on a subnet, say a work machine, behind multiple routers, you are unlikely to find out a route from the Big Wide World to your Windows machine. You can use your ssh connection to tell your Linux machine to ping the Windows machine and see what happens. Unless port forwarding is properly set up, though, you won't be able to get to it. If your work IT department is worth their salt, you should not be able to ping your local work Windows machine from outside.
Please let me know whether my re-interpretation of your original request is accurate or wildly off the mark.
If you are trying to telnet into your Linux box, does it have a telnet daemon running?
http://aplawrence.com/Linux/enable_telnet.html