问题
I am trying to use the linux command Scp to get a file of a server xx.xx.xxx.xx and onto my Desktop. Here is my syntax
scp admin@xx.xx.xxx.xx:/scraper/summary.csv /home/barns/Desktop
I am getting the error
'permission denied (publickey)'
Is my syntax incorrect?
回答1:
Yes, it's correct. Run the command with -vvv
option to find out at what stage does it break exactly. It may be either a local issue (like private key being world-readable), remote (like your public key not being found), or something during the exchange (like no common ciphers). The debug output should give you information you need.
回答2:
scp admin@xx.xx.xxx.xx:~/scraper/summary.csv /home/barns/Desktop
I needed a ~ symbol before the directory name
来源:https://stackoverflow.com/questions/35717436/scp-permission-denied-public-key