Load file into AWS server using scp

huangapple go评论135阅读模式
英文:

Load file into AWS server using scp

问题

I'm trying to copy a file from a local Mac directory to a Linux AWS server using SCP, and I keep getting the error: "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" when I run the following command?

scp -i /path/to/kp/keypair.pem /Documents/to/upload/tourmaline.zip ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com:/home/ec2-user/

(We copied the public DNS part from the instance)

When we run SSH with /path/to/kp/keypair.pem to ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com, it works, but not with SCP. Any suggestions?

I'm expecting to get the file loaded onto the Linux AWS server; we tried messing with different paths and flags.

英文:

I'm trying to copy a file from a local mac directory to a Linux aws server using scp and i keep getting the error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic when I run the following command?

scp -i /path/to/kp/keypair.pem /Documents/to/upload/tourmaline.zip ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com:/home/ec2-user/

(the amazonaws part we copied the public dns from the instance)

when we run ssh /path/to/kp/keypair.pem ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com it works, but not with scp, and suggestions?

I'm expecting to get the file loaded onto the linux aws servier, we tried messing with different paths and flags

答案1

得分: 1

看起来你的 scp 命令缺少用户信息,你应该在 ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com 前面加上 ec2-user@

scp -i /path/to/kp/keypair.pem /Documents/to/upload/tourmaline.zip \
ec2-user@ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com:/home/ec2-user/
英文:

Looks like your scp command is missing the user, you should prepend ec2-user@ to ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com:

scp -i /path/to/kp/keypair.pem /Documents/to/upload/tourmaline.zip \
ec2-user@ec2-x-xxx-xxx-xxx.us-east-2.compute.amazonaws.com:/home/ec2-user/

huangapple
  • 本文由 发表于 2023年3月4日 03:05:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75630957.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定