login surveillance program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Adnana
    New Member
    • Nov 2008
    • 1

    login surveillance program

    I am working on a program (in Python) which should display, every time a user connects to the system, a list of all logged users and the number of their active processes. Now I'd know (more or less) how to write this program in Shell, using such commands as "who" and "ps -u", but are there similar methods I could use in Python? And where should I actually look to inquire when a new user logs in? (I aren't allowed to access /var/log/wtmp)

    Thanks a lot,
    Adnana
  • Fabez
    New Member
    • Oct 2008
    • 29

    #2
    Python has a system function that will let you provide a command as a parameter and it will execute it as if you had typed it at the shell. If you have already made the utility in the shell, then you can just wrap all of your commands in the system function of Python.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      I have some suspicions about this question. If you aren't allowed into that file, then why do you need to track logins, or are you authorized to?

      Please note our policy from the Posting Guidelines
      Originally posted by Things That are Generally Unacceptable
      Posts containing any information or questions on how to hack or crack or produce code with some other malicious intent.
      I'm not accusing you of anything, for the record. So if you would explain this app further, and it is legitimate, we can help you further. We would just like to avoid helping any illegal/unethical programs.

      Comment

      Working...