3

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: root@10.88.77.77 .

Bryan Oakley
  • 341,422
  • 46
  • 489
  • 636
rushi
  • 505
  • 3
  • 7
  • 16

2 Answers2

9

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.

Community
  • 1
  • 1
Oli
  • 228,145
  • 62
  • 212
  • 294
0

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
  • 449
  • 4
  • 13