Sponsored Content
Top Forums Shell Programming and Scripting How can i get the logged in host machine ip in a ssh connection? Post 302888184 by dilipsn on Thursday 13th of February 2014 05:34:23 AM
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?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
nisupdkeys(1M)                                            System Administration Commands                                            nisupdkeys(1M)

NAME
nisupdkeys - update the public keys in a NIS+ directory object SYNOPSIS
/usr/lib/nis/nisupdkeys [-a | -C] [-H host] [directory] /usr/lib/nis/nisupdkeys -s [-a | -C] -H host DESCRIPTION
This command updates the public keys in an NIS+ directory object. When the public key(s) for a NIS+ server are changed, nisupdkeys reads a directory object and attempts to get the public key data for each server of that directory. These keys are placed in the directory object and the object is then modified to reflect the new keys. If directory is present, the directory object for that directory is updated. Oth- erwise the directory object for the default domain is updated. The new key must be propagated to all directory objects that reference that server. On the other hand, nisupdkeys -s gets a list of all the directories served by host and updates those directory objects. This assumes that the caller has adequate permission to change all the associated directory objects. The list of directories being served by a given server can also be obtained by nisstat(1M). Before you do this operation, make sure that the new address/public key has been propagated to all replicas. If multiple authentication mechanisms are configured using nisauthconf(1M), then the keys for those mechanisms will also be updated or cleared. The user executing this command must have modify access to the directory object for it to succeed. The existing directory object can be displayed with the niscat(1) command using the -o option. This command does not update the directory objects stored in the NIS_COLD_START file on the NIS+ clients. If a server is also the root master server, then nisupdkeys -s cannot be used to update the root directory. OPTIONS
-a Update the universal addresses of the NIS+ servers in the directory object. Currently, this only works for the TCP/IP fam- ily of transports. This option should be used when the IP address of the server is changed. The server's new address is resolved using getipnodebyname(3SOCKET) on this machine. The /etc/nsswitch.conf file must point to the correct source for ipnodes and hosts for this resolution to work. -C Specify to clear rather than set the public key(s). Communication with a server that has no public key(s) does not require the use of secure RPC. -H host Limit key changes only to the server named host. If the hostname is not a fully qualified NIS+ name, then it is assumed to be a host in the default domain. If the named host does not serve the directory, no action is taken. -s Update all the NIS+ directory objects served by the specified server. This assumes that the caller has adequate access rights to change all the associated directory objects. If the NIS+ principal making this call does not have adequate per- missions to update the directory objects, those particular updates will fail and the caller will be notified. If the rpc.nisd on host cannot return the list of servers it serves, the command will print an error message. The caller would then have to invoke nisupdkeys multiple times (as in the first synopsis), once per NIS+ directory that it serves. EXAMPLES
Example 1: Using nisupdkeys The following example updates the keys for servers of the foo.bar. domain. example% nisupdkeys foo.bar. This example updates the key(s) for host fred that serves the foo.bar. domain. example% nisupdkeys -H fred foo.bar. This example clears the public key(s) for host wilma in the foo.bar. directory. example% nisupdkeys -CH wilma foo.bar. This example updates the public key(s) in all directory objects that are served by the host wilma. example% nisupdkeys -s -H wilma ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
chkey(1), niscat(1), nisaddcred(1M), nisauthconf(1M), nisstat(1M), getipnodebyname(3SOCKET), nis_objects(3NSL), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 13 Dec 2001 nisupdkeys(1M)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy