RespawnTheory
RespawnTheory

Reputation: 11

How to clean .ssh config file after deleting a host?

Sorry, I'm entirely new to this and have been trying to follow some tutorials on making git repositories (with gitlab) and using virtual machines (with AWS ec2), separately. I was following the git tutorial relatively well, but I have no idea what I'm doing with AWS. And the stuff I configurated with AWS without understanding has started to affect my git practice.

When I tried to push some commits to a new remote repository I connected with an SSH url, this happened:

/Users/Hail/.ssh/config line 5: garbage at the end of line; "HD/Applications/labsuser.pem"

I opened the .ssh/config file and it looks like this:

enter image description here

Firstly, I don't know why that file has been opened or when I set it up that way. And secondly, the host(an instance in AWS?) in the config file has been deleted and I have new instances in AWS.

After changing the url from SSH to HTTPS in .git/config file of the local repository, I managed to successfully push the commits to the local repository. But I would still like to know what was happening with the .ssh config file, and what to do with it.

Upvotes: 1

Views: 436

Answers (1)

VonC
VonC

Reputation: 1324537

The issue might be the space in the IdentityFile field.

Try at least

IdentityFile "My path /with space"

Then test it with:

ssh -Tv chatbot

You can see an example in "How to SSH to AWS servers using an SSH config file?" from Mandeep Singh.

Upvotes: 2

Related Questions