9

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 ?

Prasanna Wagh
  • 101
  • 1
  • 5

3 Answers3

8

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.

Antimony
  • 394
  • 4
  • 5
8

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.

jaaq
  • 1,188
  • 11
  • 29
  • 2
    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 Aug 10 '21 at 16:34
  • Yep, VSCode does it all :) – jaaq Aug 16 '21 at 06:41
0

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

Temuujin Dev
  • 692
  • 2
  • 8
  • 20