10

I am setting my systems for codecommit. but getting following error

I followed the below link : https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-windows.html

/c/Users/Prasanna/.ssh/config: line 1: Bad configuration option: \377\376h /c/Users/Prasanna/.ssh/config: terminating, 1 bad configuration options

here is the config file Host git-codecommit.*.amazonaws.com User ******** IdentityFile ~/.ssh/codecommit_rsa

Am I missing anything to configure ?

3 Answers 3

10

Just had the same issue. Open the file with Notepad++. On the bottom right it tells you the encoding the file is in. It has to be UTF-8 without BOM. You can fix that via selecting a new encoding at the top and saving the file.

2
  • 3
    can do the same with VSCode: the key is to make sure it's UTF-8. When I re-opened the file that I had created as UTF-8, a bunch of weird chars were present and it was just a matter to delete them to get rid of the error
    – fabiog1901
    Commented Aug 10, 2021 at 16:34
  • Yep, VSCode does it all :)
    – jaaq
    Commented Aug 16, 2021 at 6:41
9

You probably have some illegal characters in the config file. I had this problem while creating a config file on Windows. Unfortunately, simply opening the file in a Windows text editor may not show the illegal characters.

I was able to find this problem by running cat filename from a Bash prompt in Windows (git bash) and was able to fix it by running dos2unix filename in git bash. The same may work for you as well.

1
  • 1
    Or opening in Webstorm (or equivalent) can reveal illegal characters like NBSP
    – blub
    Commented Jun 28, 2021 at 12:31
0

This happened to me today, and I just recreated the config file and put my configs there, it works.

Not the answer you're looking for? Browse other questions tagged or ask your own question.