I'm working on a python script that stores ssh passwords only during the current session. What I'm doing is declaring a class variable credentials = {}. When the script needs access to a specific server, it checks in credentials to see if credentials['server'] exists. If it does, it uses the password there, if it doesn't, it prompts the user.
This is all working fine, but I'm just wondering if that's a bad way of implementing this? This isn't running anywhere critical that I need to be THAT concerned about security. I was just thinking it'd be nice if I could declare credentials as private.
Is this a reasonable approach? Is there a more pythonic way to do this or one that's better suited for how python deals with class member access?