By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,522 Members | 1,770 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,522 IT Pros & Developers. It's quick & easy.

login surveillance program

P: 1
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
Nov 3 '08 #1
Share this Question
Share on Google+
2 Replies


P: 29
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.
Nov 3 '08 #2

Curtis Rutland
Expert 2.5K+
P: 3,256
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
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.
Nov 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.