How can i get the logged in host machine ip in a ssh connection?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can i get the logged in host machine ip in a ssh connection?
# 1  
Old 02-13-2014
How can i get the logged in host machine ip in a ssh connection?

Hi All,
I have a basic question.
In my system i maintained multiple unix server, and only one server has public ip, and all the servers are behind load balancing BIG ip server.
To access any server, user need to access server with public IP then from there they can establish ssh connection to required server.

Now my query is...
Is it possible to get the currently logged in host ip?
If i type "who" command in that server its displaying my gateway server ip (one server with public ip) but i cant get the external host IP
How can i get the logged in host ip, which executes a particular command?
# 2  
Old 02-13-2014
That should be visible on that mentioned gateway server. It will not be visible on your server that sits behind the gateway, since only the gateway connects to it.
I am not sure why there is that gateway server, but in terms of security it would be a good place to track incoming logins and where they are headed to.

I have no experience with BIG IP products, but it sounds interessting and I found this:
AskF5 | Manual Chapter: Event Logging

So assume this could be the place where should be looked at. Or if the rest of the product is set up on top of the OS and logs at another place, then at this place Smilie

Last edited by zaxxon; 02-13-2014 at 07:56 AM..
# 3  
Old 02-14-2014
Thank you Zaxxon,
My conern is...is there any technique or command through which we can get the complete details of the hops between the source and destination? In my case it is hops between my server to client....

Because my intention is....i have script in my one of the server it needs the IP of the host through which user logged in to the server(ssh connection)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

2. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

3. Red Hat

Unable to SSH into machine - ssh_exchange_identification: Connection closed by remote host

For a few days now I have been experiencing issues when trying to SSH into 1 of my machine. I get the following output when running 'ssh -vvv': server1:/home/mymadq> ssh -l root -vvv server2 OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 debug1: Reading configuration data /etc/ssh/ssh_config... (3 Replies)
Discussion started by: jaapar
3 Replies

4. Shell Programming and Scripting

ssh connection from remote machine in solaris

Hi! I have two solaris 10 machines(say 10.1.1.1,10.1.1.2). i have installed rsync on 10.1.1.2, 10.1.1.1::: Sun Microsystems Inc. SunOS 5.10 Generic January 2005 -bash-3.00$ ssh 10.1.1.2 "echo $PATH" Password:... (4 Replies)
Discussion started by: dddkiran
4 Replies

5. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

6. Programming

Check if user logged into remote machine via C++ / Java

Hi, I have a program running on HP-UX and it must checkwhether a user has already logged-in to another machine. The hostname of the other machine is known when the check has to be made. Is there a way which this can be accomplished using C++ or Java? If not I could parse the output of a... (6 Replies)
Discussion started by: johnmmcparland
6 Replies

7. UNIX for Advanced & Expert Users

"Connection closed by remote host" while doing ssh to a solaris box

Hi All, When i try to do ssh from a linux to solaris box its throughing "Connection closed by remote host". Please not that this error is not occuring every time i do ssh, it occurs at random timing( Mostly ssh is successful) - unfortunately my script which is doing ssh is falling at this time... (4 Replies)
Discussion started by: pkumar7
4 Replies

8. UNIX for Advanced & Expert Users

connecting through master ssh connection on intermediate host

Suppose host B does not allow public/private key authentication - only secureID authentication. I already have a master ssh connection from host A to host B. Host A does allow public/private key authentication. Is there any way to connect from host C to host B by way of the master ssh connection... (2 Replies)
Discussion started by: cpp6f
2 Replies

9. Shell Programming and Scripting

check ssh connection to remote host

I am using KSH and I need to check whether the remote host has been configured with ssh public key. Is there any way we can check inside a script? (6 Replies)
Discussion started by: praveenbvarrier
6 Replies

10. UNIX for Advanced & Expert Users

Users logged in longer than machine uptime?

SCO 5.06 Anyone ever have an issue where: uptime returns: SCO:/# uptime 4:40pm up 4:50, 1 user, load average: 0.00, 0.00, 0.00 w returns: SCO:/# w User Tty Login@ Idle JCPU PCPU What root tty01 - 72:20 - - -ksh I've rebooted yet... (1 Reply)
Discussion started by: gseyforth
1 Replies
Login or Register to Ask a Question