title: SSH Private Key Not Working After Fetching It From Google's Secret Manager
body: <p>I have an SSH Private Key which I use to SSH into some server. I have tested the key and it works perfectly. I have uploaded the key to Google Cloud Secret Manager, but when I fetch it from the Secret Manager using the <em>gcloud secrets versions access</em> command, the key does not work and this error is returned instead:</p>
  <pre><code>Load key &quot;id_rsa&quot;: invalid format
  </code></pre>
  <p>Is there a way I can get the key while preserving its format? Or can I reformat the key?</p>
  <p><strong>What I have tried so far</strong></p>
  <p>I have tried getting the key in using different formats;</p>
  <pre><code>gcloud secrets versions access latest --secret=${SECRET} --format=&quot;json&quot; | jq -r .payload.data | base64 --decode &gt; id_rsa
  
  gcloud secrets versions access latest --secret=${SECRET} --format='get(payload.data)' | tr '_-' '/+' | base64 -d &gt; id_rsa
  </code></pre>
  <p>But it has not worked.</p>