How to identify User Machine name?

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to identify User Machine name?
# 1  
Java How to identify User Machine name?

Hi Experts,

We 4 to 5 people are using same UNIX(Solaris) login for our testing purpose. Also we are doing some modifications to existing scripts.

Is it possible to know the each user machine (IP address or machine name) who are using the same login to modify the scripts. So that we can easily identify who are modified what?

Please help me.

# 2  
check the w command. it will tell you from which IP address users have logged in
# 3  
Originally Posted by Yogesh Sawant
check the w command. it will tell you from which IP address users have logged in

Certain compiled versions of 'w' can disable the display of 'from column' as NULL

Best would be use and parse the /etc/utmp structure
# 4  
Hammer & Screwdriver

Thanks much Yogesh.

'w' is partially solved my problem. Also 'who' will give the machine IP address, which is more easier to identfy the user who are logged in.

But my two more doubts are:
1. How to idetify from which IP address, the files get altered.
2. How to get the previous history to identify who are logged in at what time and when they have logged out.

Any help will definitely use ful to enhance my UNIX knowledge.

Much Regards,
# 5  
You might want to have a look at lsof. I don't know if it is installed by default on Solaris but I'm pretty sure you could find a package for it:

From man page :

Lsof revision 4.77 lists information about files opened by processes for the following UNIX dialects:

An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.) A spe‐cific file or all the files in a file system may be selected by path.

lsof | grep TCP output example :

firefox-b 5046 snerge 55u IPv4 170429 TCP> (ESTABLISHED)
firefox-b 5046 snerge 61u IPv4 170444 TCP> (ESTABLISHED)
firefox-b 5046 snerge 63u IPv4 170450 TCP> (ESTABLISHED)
# 6  
Thanks for your help.
But sorry Im not getting it clearly.

I Need some more easy steps. Please.

With Regards,
Ganapati. Smilie
# 7  
Try this...

Assuming that the <file_name> is an open file used by a process.

who | grep $(lsof <file_name> | sed -n '2,$p'| awk '{ print $3}'|uniq)
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #618
Difficulty: Medium
Python is strongly object-oriented in the sense that everything is an object including numbers, strings and even functions.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to identify user?

Hi Team I have created some time back a user called "iuser" but I am not able to login with it. I am getting below error. # su - iuser su: user iuser does not exist tried to unlock the user still get same error # pam_tally2 -u iuser -r pam_tally2: pam_get_uid; no such user iuser... (7 Replies)
Discussion started by: scriptor
7 Replies

2. Cybersecurity

Please help identify these user account

Please help me identify these user accounts.. bin, lp, nuucp, smbnull, mysql, tftp Can we remove these user or disable these users?We have to apply the security policy about the user identification.Since it was settup by our vendor long time ago. We do not have these informations about these... (3 Replies)
Discussion started by: rdstkg
3 Replies

3. AIX

Identify User Attributes

SOS Guys... Is there any way to determine the user attributes, mainly if that userid is set as never expire? I do not have admin rights, and I'm working on AIX 5.3 I've tried : lsuser -f <username> but no luck on that (2 Replies)
Discussion started by: freakygs
2 Replies

4. Shell Programming and Scripting

User perl to get memory installed in a machine

I currently have a statistics gathering script i run on my Linux servers. One of the stat i gather is total memory in the machine. The script is all perl with the exception of gathering the memory for that i use the following command: $ram = (`cat /proc/meminfo | grep "MemTotal" | awk... (1 Reply)
Discussion started by: insania
1 Replies

5. Shell Programming and Scripting

Identify root like user.

Hi All, I wanted to know if there is any way , in which a user could be identified. I need to diffrenciate between a root user and a root like user. Thanks! nua7 (4 Replies)
Discussion started by: nua7
4 Replies

6. UNIX for Advanced & Expert Users

scp from user A in machine 1 to user B in machine 2

Hi all, would like to find out how can i scp a file from user A in one host to user B in another host? i know how to get it done if its from user A in machine 1 to user A in machine 2. 1)on machine 1, generate a key pair. put the private key in the .ssh directory. 2)put the public key in... (2 Replies)
Discussion started by: new2ss
2 Replies

7. Shell Programming and Scripting

Identify specific processes from different Machine

Hi, i;m getting a hard time on how to have this kind of script. 1. ssh on another machine and check if a specific process is running and notify in there is a problem. SOS!!!!!!!!!!!!! :( (2 Replies)
Discussion started by: tungaw2004
2 Replies

8. UNIX for Advanced & Expert Users

Identify a remote machine as windows or unix

Hi, I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?. Regs Anand (5 Replies)
Discussion started by: u449064
5 Replies

9. SCO

Need Script to check whether user exists in the remote machine

Hi All, I am new to shell scripting. Can someone let me know, how to check whether the user exists in the remote system? I am building a new unix box and before I proceed installing the appliation , I want to check whether the required users are created in the system . how to do this ?... (1 Reply)
Discussion started by: Srini75
1 Replies

10. Shell Programming and Scripting

Executing Script of a different user on Same Machine

Hi, I want to execute a script - of different user from my script. I have tried the su command su - username -c "scriptname" it works but asked for password. Is there any way for supplying the password to it thru script, not interactively. Or is there any other way to achieve the... (5 Replies)
Discussion started by: yeheyaansari
5 Replies

Featured Tech Videos