Sponsored Content
Operating Systems Solaris How to get the IP address / Host name of client machine Post 302240187 by MVL on Thursday 25th of September 2008 07:08:05 AM
Old 09-25-2008
How to get the IP address / Host name of client machine

Hi

How to get the IP address / Host name of a particular user connected to Unix Server.

For example: If used 'DevUser1' is connected to Unix server. I need to find out from which PC this connection has been made.

How can this be achieved?

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Host IP address for a telnet session

I am using Tru64UX 5.1a on alphaserver 4100. Users access the application through Telnet sessions to this server. My requirement is to limit the users login through their PCs only. Is there any way I can accomplish this on the unix box ? I want to include a script in the .profile ( or... (1 Reply)
Discussion started by: shauche
1 Replies

2. Solaris

Host ID vs MAC Address

Hi, I've got a Sun Solaris machine with host ID (840f8e57) and MAC address (0:14:4f:f:8e:57), how do I: 1. Write the MAC address in standard (IEEE 802) format, i.e. xx-xx-xx-xx-xx-xx? Do I need to add 0's before or after the 'f', i.e. 00-14-4f-0f-8e-57 or 00-14-4f-f0-8e-57? 2. What is... (4 Replies)
Discussion started by: TheBlueSky
4 Replies

3. Programming

host name to IP address

There's a piece in a C program I'm writing (Linux) that simply needs to take a host name and return an IP address (e.g., take 'mail.gnu.org' and return 199.232.76.166). I've gotten a successful status from getaddrinfo, but don't see any of the fields in the result structure that has what I'm... (7 Replies)
Discussion started by: cleopard
7 Replies

4. Solaris

No value in Ethernet address and Host ID at Ok prompt

Hi All, In Ultra 10 at time system is not displaying value for Ethernet address and Host ID. Also, when i am trying to change the value of environment variables i am getting below message and value is not changing Thanks (4 Replies)
Discussion started by: kumarmani
4 Replies

5. Programming

get host name by IP address

I'm trying to write a function to get the host name of any given IP address. I'm trying to follow this manual but I'm stuck. I'm using gcc and Linux. Any ideas? getnameinfo() #include <stdio.h> #include <netdb.h> #include <sys/socket.h> #include <arpa/inet.h> char... (6 Replies)
Discussion started by: limmer
6 Replies

6. UNIX for Dummies Questions & Answers

Host ID in Solaris Machine

Hi, On doing reinstallation of Solaris 10 OS, does an existing host id change? Regards, Thiru (1 Reply)
Discussion started by: nthiruvenkatam
1 Replies

7. Shell Programming and Scripting

Host Machine not listed.

Hello everyone, I have a perl script to list all the host machines in my development environment. The script does various other tasks apart from listing the host names in an excel output. The problem is with the listing of host machines. The script lists all the host names except the host on which... (1 Reply)
Discussion started by: nmattam
1 Replies

8. Solaris

machine server and machine client

Hello, i need to create a communication between two machines solaris 2 installed in VM workstation; to begin with NFS and do these : Machine A : share -F nfs /opt and in Machine B : mount -F nfs machineA:/opt /mnt also share -F nfs -o rw=machineB /opt and in B mount -F nfs... (0 Replies)
Discussion started by: herbich1985
0 Replies

9. IP Networking

IP address to host name conversion

hi, i want to get the hostname for the specified IP address. # host www.google.com www.google.com has address 173.194.69.104 www.google.com has address 173.194.69.105 www.google.com has address 173.194.69.106 www.google.com has address 173.194.69.147 www.google.com has address... (3 Replies)
Discussion started by: kavitha rao
3 Replies

10. Linux

Unable to connect to Server machine from a client machine using ftp service

Hi, Could you please help me with the below issue.. I'm running RHEL6 OS on both server (192.168.0.10) and client machines (192.168.0.1). I'm trying to connect to server from the client machine using ftp service. I have installed vsftpd daemon on both the machines. I'm getting... (4 Replies)
Discussion started by: raosr020
4 Replies
socket(n)						       Tcl Built-In Commands							 socket(n)

__________________________________________________________________________________________________________________________________________________

NAME
socket - Open a TCP network connection SYNOPSIS
socket ?options? host port socket -server command ?options? port _________________________________________________________________ DESCRIPTION
This command opens a network socket and returns a channel identifier that may be used in future invocations of commands like read, puts and flush. At present only the TCP network protocol is supported; future releases may include support for additional protocols. The socket command may be used to open either the client or server side of a connection, depending on whether the -server switch is specified. Note that the default encoding for all sockets is the system encoding, as returned by encoding system. Most of the time, you will need to use fconfigure to alter this to something else, such as utf-8 (ideal for communicating with other Tcl processes) or iso8859-1 (useful for many network protocols, especially the older ones). CLIENT SOCKETS
If the -server option is not specified, then the client side of a connection is opened and the command returns a channel identifier that can be used for both reading and writing. Port and host specify a port to connect to; there must be a server accepting connections on this port. Port is an integer port number (or service name, where supported and understood by the host operating system) and host is either a domain-style name such as www.sunlabs.com or a numerical IP address such as 127.0.0.1. Use localhost to refer to the host on which the command is invoked. The following options may also be present before host to specify additional information about the connection: -myaddr addr Addr gives the domain-style name or numerical IP address of the client-side network interface to use for the connection. This option may be useful if the client machine has multiple network interfaces. If the option is omitted then the client-side interface will be chosen by the system software. -myport port Port specifies an integer port number (or service name, where supported and understood by the host operating system) to use for the client's side of the connection. If this option is omitted, the client's port number will be chosen at random by the system soft- ware. -async The -async option will cause the client socket to be connected asynchronously. This means that the socket will be created immedi- ately but may not yet be connected to the server, when the call to socket returns. When a gets or flush is done on the socket before the connection attempt succeeds or fails, if the socket is in blocking mode, the operation will wait until the connection is com- pleted or fails. If the socket is in nonblocking mode and a gets or flush is done on the socket before the connection attempt suc- ceeds or fails, the operation returns immediately and fblocked on the socket returns 1. SERVER SOCKETS
If the -server option is specified then the new socket will be a server for the port given by port (either an integer or a service name, where supported and understood by the host operating system). Tcl will automatically accept connections to the given port. For each con- nection Tcl will create a new channel that may be used to communicate with the client. Tcl then invokes command with three additional arguments: the name of the new channel, the address, in network address notation, of the client's host, and the client's port number. The following additional option may also be specified before host: -myaddr addr Addr gives the domain-style name or numerical IP address of the server-side network interface to use for the connection. This option may be useful if the server machine has multiple network interfaces. If the option is omitted then the server socket is bound to the special address INADDR_ANY so that it can accept connections from any interface. Server channels cannot be used for input or output; their sole use is to accept new client connections. The channels created for each incoming client connection are opened for input and output. Closing the server channel shuts down the server so that no new connections will be accepted; however, existing connections will be unaffected. Server sockets depend on the Tcl event mechanism to find out when new connections are opened. If the application doesn't enter the event loop, for example by invoking the vwait command or calling the C procedure Tcl_DoOneEvent, then no connections will be accepted. If port is specified as zero, the operating system will allocate an unused port for use as a server socket. The port number actually allo- cated my be retrieved from the created server socket using the fconfigure command to retrieve the -sockname option as described below. CONFIGURATION OPTIONS
The fconfigure command can be used to query several readonly configuration options for socket channels: -error This option gets the current error status of the given socket. This is useful when you need to determine if an asynchronous connect operation succeeded. If there was an error, the error message is returned. If there was no error, an empty string is returned. -sockname This option returns a list of three elements, the address, the host name and the port number for the socket. If the host name cannot be computed, the second element is identical to the address, the first element of the list. -peername This option is not supported by server sockets. For client and accepted sockets, this option returns a list of three elements; these are the address, the host name and the port to which the peer socket is connected or bound. If the host name cannot be computed, the second element of the list is identical to the address, its first element. SEE ALSO
fconfigure(n), flush(n), open(n), read(n) KEYWORDS
bind, channel, connection, domain name, host, network address, socket, tcp Tcl 8.0 socket(n)
All times are GMT -4. The time now is 11:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy