newb Q: security with variables

Steve Purcell stephen_purcell at yahoo.com
Mon Jul 24 07:10:39 EDT 2000


Toy <gee308 at m...> wrote:
> Could you please explain to me various secure ways of having a 
> python script store variables such as your password/username in a
> file.
> I understand that you can chmod 0400 <variables.file>, but are
> there any other alternatives?

If you're going to put a username/password combination in a file, and
if that's because you don't want to require a password to be entered
interactively when the program runs, then there's nothing much you can
do. The security of the file system is as good as you can hope for.

> Also, can you run python code with files that don't end with the 
> python extensions(.py and others)?  That way it would make it less
> obvious that it was some sort of script.  Thanks

Yes. Simply 'chmod +x scriptname' and make the first line of the
script read '#!/usr/bin/env python'. But, an executable file is almost
as obviously a script as a '.py' file.

-Steve

--
Steve Purcell,  Technical Director, Inkontact
Get in touch at http://www.inkontact.com/
"Life must be simple if I can do it" -- Me





More information about the Python-list mailing list