How to identify User Machine name?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to identify User Machine name?
# 1  
Old 02-28-2007
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.

Ganapati.
Mysore.
# 2  
Old 02-28-2007
check the w command. it will tell you from which IP address users have logged in
# 3  
Old 02-28-2007
Quote:
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  
Old 02-28-2007
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,
Ganapati.
# 5  
Old 02-28-2007
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 192.168.1.105:60473->wx-in-f19.google.com:https (ESTABLISHED)
firefox-b 5046 snerge 61u IPv4 170444 TCP 192.168.1.105:32840->od-in-f104.google.com:www (ESTABLISHED)
firefox-b 5046 snerge 63u IPv4 170450 TCP 192.168.1.105:32841->od-in-f104.google.com:www (ESTABLISHED)
# 6  
Old 03-01-2007
Thanks for your help.
But sorry Im not getting it clearly.

I Need some more easy steps. Please.

With Regards,
Ganapati. Smilie
# 7  
Old 03-01-2007
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 to Ask a Question

Previous Thread | Next Thread

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

Tricky little problem, send signal to other machine without user

Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on. So, I want... (5 Replies)
Discussion started by: declannalced
5 Replies

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

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

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

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

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

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
Login or Register to Ask a Question