Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error when exec'ing scp from python

Tags:

python

scp

ssh

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] .

like image 666
rushi Avatar asked Apr 14 '26 06:04

rushi


1 Answers

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.

like image 104
Oli Avatar answered Apr 15 '26 20:04

Oli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!