Why does a key on WSL2/Ubuntu open the credentials file but on another machine/server it doesn’t?

Solution for Why does a key on WSL2/Ubuntu open the credentials file but on another machine/server it doesn’t?
is Given Below:

I’ve got a weird situation. I create credentials using my key on wsl2 using ubuntu. when the repo is pushed to a staging server also running ubuntu, the same key cannot open the staging credentials file even though it was used to create it locally. WTF?

It also doesn’t work to open the development credentials file on another laptop running macOS.

I’ve taken the following steps:

  1. In VSCode I made sure line endings were to `n’
  2. For git I did: git config --global core.autocrlf false

I haven’t had this happen before to this extent, before, and it’s starting to become an issue. Also, credentials created on another machine won’t work on my machine, even if I never open it in anything besides vim or nano.

I also tried scping both the staging.key and staging.credentials.yml.enc files from the server and tried to edit them locally and the same thing happens.