Copy files from private EC2 instance to local machine

0

Hi,

I have a requirement of copying files from private EC2 instance to my local machine. I have port forwarded a EC2 instance to local using below command.

aws ssm start-session
--target instance-id
--document-name AWS-StartPortForwardingSession
--parameters '{"portNumber":["22"], "localPortNumber":["2222"]}'

Now is there a way to copy files from EC2machine to local machine without passing PEM keys. I have tried it but getting error

scp -P 2222 ec2-user@localhost:/var/log/yumlog /home/user ec2-user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Can any one guide to copy the files.

1개 답변
1
수락된 답변

Hi, yes, right way to go for your goal is scp not ssm. See https://dearsikandarkhan.medium.com/files-copying-between-aws-ec2-and-local-d07ed205eefa

Corresponding AWS reference documentation is here: https://docs.aws.amazon.com/managedservices/latest/appguide/qs-file-transfer.html

Follow in details all the guidance about security groups and access key creation / management to get it to work properly.

Best,

Didier

profile pictureAWS
전문가
답변함 9달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠