问题
I am trying to create dev-endpoint server on EC2. I must copy my SSL certificate key store onto the Amazon EC2 instance
scp -i ec2-private-key keystore.jks ec2-user@dns-address-of-ec2-instance:~/keystore.jks
I followed ssl-certificate tutorial. How should my scp line look like?
scp -i server.key server.cert ec2-user@my....
回答1:
You should use the following command:
scp -i $EC2_PEM $FILE $USERNAME@$REMOTE_HOST_ADDRESS:~/$PATH_TO_REMOTE_LOCATION
In this the following is what to use for the variables:
$EC2_PEM
- The PEM for connecting to the server (what you would use to SSH)$FILE
- The name of the file (private key/public key), providing the full path (either absolute or relative) to the SSL on your current host machine$USERNAME
- The username used to SSH to the remote hostREMOTE_HOST_ADDRESS
- Either the IP address or domain name of the server you are attempting to SCP the file to$PATH_TO_REMOTE_LOCATION
- The path that the file will live on disk
You will need to run this for each file individually.
来源:https://stackoverflow.com/questions/62815134/how-to-copy-ssl-certificate-from-a-certificate-authority-to-ec2