Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/SCP with a Key

October 22, 2020

SCP with a Key

SCP is a secure copy utility in Linux. You’ll need access to your system. In this example, a pem key is used to authenticate to a host. SCP copies filename.ext to the home directory of ec2-user. It’s important to add the target directory, otherwise it will not work.

Here’s how to use SCP with a key from local to server.

scp -i key.pem filename.ext user@server:/home/user

scp -i key.pem filename.ext user@server:/home/user

From server to local. Run the command from local machine.

scp user@server:/home/user/file.txt /local/directory

scp user@server:/home/user/file.txt /local/directory

Filed Under: Linux Tagged With: copy, ec2-user, key, pem, scp

Have content delivered to your mail. Subscribe below.

About Me

I'm Ulysses, Cloud Engineer at Cardinal Health based in Columbus. This blog is about Linux and Cloud technology. When off the grid, I enjoy riding my electric skateboard. I've surfed, snowboarded and played the saxophone in the past. I hope you find this website helpful. It's powered by WordPress and hosted on AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021