Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting .ssh directory on self hosted runner is terrible #231

Closed
MikeWarriner opened this issue Dec 27, 2022 · 5 comments · Fixed by #251
Closed

Deleting .ssh directory on self hosted runner is terrible #231

MikeWarriner opened this issue Dec 27, 2022 · 5 comments · Fixed by #251

Comments

@MikeWarriner
Copy link

Latest modifications to delete .ssh directory by default result in directory being deleted on self-hosted runner, removing remote access to server if any pre-existing SSH configuration such as authorized_hosts is present.

Please revoke change, or at least put behind a feature whose default value is to preserve the original settings.

@dpagini
Copy link

dpagini commented Jan 5, 2023

Ugh. This just caused me an enterprise outage as well. We are also using a self-hosted runner. I wasn't able to figure out what about this release caused everything to break, but rolling back to 2.4.0 fixed everything for me.

I was actually seeing that none of my SSH files were being copied to my runner when using the 2.5.0 build. So it wasn't just about the delete, I don't believe.

@mym0404
Copy link

mym0404 commented Jan 13, 2023

👍🏻 I just restored all my local ssh keys......

I think the package should provide one of the following.

  • input to choose whether delete ssh dir or not
  • custom path to ssh install

@khoazero123
Copy link

I made fork for add new option cleanup to keep the .ssh folder.

https://github.com/khoazero123/ssh-key-action#usage

- name: Install SSH key for LIVE
        uses: khoazero123/ssh-key-action@dev
        with:
          key: ${{ secrets.DEPLOY_SSH_KEY_LIVE || vars.DEPLOY_SSH_KEY_LIVE }}
          name: id_rsa-bastion # optional
          known_hosts: unnecessary
          if_key_exists: replace # replace / ignore / fail; optional (defaults to fail)
          cleanup: false # Should remove .ssh directory? set false to keep .ssh directory

@albertodebortoli
Copy link

Thank you. I just tried this action and it caused an outage on our CI.

@shimataro
Copy link
Owner

Very sorry for the late reply.
This issue will be fixed in #251, which will be shipped soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment