in Education by
I have a local git repo and when I do a git push, I need the repo to be pushed to my EC2 instance. But, in the above tutorial, when I do a git push origin master, I get Permission denied (publickey) error because I did not specify the identity file. Say, I login to EC2 like this: ssh -i my_key.pem [email protected] So, can I do something similar here to: git -i my_key.pem push origin master or set the identity file in .git/config So, how can I set it up? Update: Output of git config -l user.name=my name [email protected] github.user=userid core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true core.ignorecase=true remote.origin.url=ec2_id@my_e2_ip_address:express_app remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Try this to copy your local ssh key to Amazon cat ~/.ssh/id_?sa.pub | ssh -i amazon-private-key.pem ec2-user@ec2-instance-public-dns "cat >> .ssh/authorized_keys" Replace the key names and also the public DNS of your amazon ec2 instances After this, you will be able to set up your remote on Amazon

Related questions

0 votes
    I want to automate the launch of a set of Linux EC2 instances. Basically, I want to write a script/program that ... in Amazon AWS/EC2? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I installed Ubuntu 12.04 on my instance and am trying to install packages using apt-get, but I am getting the ... do I fix this? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    Bit confused here, I have an on-demand instance but do I get charged even when I stop the instance? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How can I delete instance in Amazon EC2. I have terminated the instance but still it was showing in ... instance gets terminated Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to change the time zone set in my Amazon EC2 instance running Ubuntu Linux to local time. My Question ... zone in Amazon EC2? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    We have a large ec2 instance running in Asia pacific region. We want to reserve that particular instance.In aws ... out on something Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to add port 8080 to the EC2 security group to access tomcat. But whenever I select HTTP from drop ... access Tomcat publicly? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to add port 8080 to the EC2 security group to access tomcat. But whenever I select HTTP from drop ... access Tomcat publicly? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    How should I use the new AWS EC2 classes (r3, i2) with my existing AMI without recreating the whole system ... only PVM AMI images. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I need SSH access to an Amazon EC2 instance running Ubuntu. All I have is the Amazon username and password. Any ideas? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I understand nearly nothing to the functioning of EC2. I created an Amazon Web Service (AWS) account. Then I ... user's guide. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm currently running an ec2 micro instance and i've been finding that the instance occasionally runs out of memory. ... can be done? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    How can I find out the instance id of an ec2 instance from within the ec2 instance? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I want to upgrade my Amazon EC2 micro (t1.micro) instance to large. Please help. Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I want to migrate my webapp from Amazon EC2 to ECS. I ECS I have to allocate memory and vCPU for the ... needed for the process? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
...