View Full Version : python, ssh

May 10th, 2011, 08:33 PM

I'm wondering if someone is able to offer some advice. I've created a simple python program using paramiko so take a screenshot and transfer it to a server using ssh. I know it bad practice to hard code user name and password into a application, but i wanted it to happen without any user interaction just run a script. So i'm wondering if anyone has any advice to obsure the combination or a different method to use/

Many Thanks,


May 10th, 2011, 10:48 PM
The ~/.netrc config file is a place where users can store their ftp logins and passwords. An ftp client can then be directed to use the netrc file instead of prompting the user. Python even has a module for parsing this file.


A netrc entry looks like this:

machine ftp.example.com
login joe
password 12345

curl, can be made to use netrc with the --netrc switch.

Another thing you could try is passwordless ssh.