tags:

views:

93

answers:

2

hi,

this code is giving following error:

os.system("scp %s:/export/home/sample/backup.sql  %s:/home/rushi/abc.sql" % (a, b))

Permission denied (publickey,keyboard-interactive).
lost connection

a and b are the command line arguments which accept user name and machine name as arguments:

eg: [email protected] .

+8  A: 

This has nothing to do with Python and everything to do with SSH.

Permission denied (publickey,keyboard-interactive).

It's telling you you have failed to log in. I suggest you either sort your key-based auth out or pass it a password.

See: http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1

Or instead of trying to use the scp command, use a pure-python method.

Oli
A: 

That error is coming from scp. What happens if you run the command yourself? Are you expecting to use public key to connect or do you have to enter a password?

Neth
i have to enter a password bt after i enter,it gives me this error
rushi
I'd say Oli probably has the right idea.
Neth