Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an script called wow.sh on a shared machine.

'ps -ef | grep wow' shows multiple runs of the same script.

How can I use the tty information to find the offending users ip?

share|improve this question

migrated from stackoverflow.com Aug 7 '10 at 11:40

This question came from our site for professional and enthusiast programmers.

3 Answers 3

You can try "last", which will show you last logins. So if you narrowed it down to a user, you can run last username and the 3rd column is their login origin.

share|improve this answer

In the most basic sense, you need to track down who ran it and where they logged in from:

ps axo command,user,lstart | grep [w]ow

The 2nd field gives you the user. If this is obvious (i.e. not 'root' or some shared username) then you can use 'last' as Alex mentions:

ps axo user,command,lstart | grep [w]ow | cut -f1 -d' ' | xargs last -n 1000 -iF

Just match up their date from the first command (the 'lstart' last column) with the login/logout reported by last.

share|improve this answer
    
All the users login using a common user. The only thing to differentiate between them is the tty information. I want to find out the ip using the tty information. –  AM01 Aug 12 '10 at 19:32

If the offending party will still be logged in (i.e. they're not disown-ing scripts or similar) then who will give you the IP and tty of the logged-in users.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.