Skip to content

~/.ssh/ is cleared between runs #8006

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

Closed
0xJem opened this issue Feb 3, 2022 · 3 comments
Closed

~/.ssh/ is cleared between runs #8006

0xJem opened this issue Feb 3, 2022 · 3 comments

Comments

@0xJem
Copy link

0xJem commented Feb 3, 2022

Bug description

If a workspace encounters a timeout and is relaunched, the contents of the ~/.ssh/ directory are cleared. This makes it cumbersome to get running again, as the keys need to be copied over.

Steps to reproduce

  1. Open a workspace in VSCode (probably on the web too, but I've only tested VSCode)
  2. Copy across keys into ~/.ssh/
  3. Let the workspace timeout. VSCode won't re-connect.
  4. Open Gitpod.io, launch the same workspace.
  5. ~/.ssh/ will only contain authorized_keys and supervisor_env

Workspace affected

magenta-prawn-qs8g067f

Expected behavior

The contents of the ~/.ssh/ directory should persist.

Example repository

No response

Anything else?

No response

@atduarte
Copy link
Contributor

atduarte commented Feb 3, 2022

Currently, only the /workspace/ folder is backed up and therefore preserved.

We are planning to tackle this issue by implementing a "full backup of the workspace". See #7719. Given that, will mark this as a duplicate.

@atduarte atduarte closed this as completed Feb 3, 2022
@axonasif
Copy link
Member

axonasif commented Feb 3, 2022

@0xJem in your .gitpod.yml before: task you can do such a thing:

tasks:
  - before: rm -rf $HOME/.ssh; mkdir -p /workspace/.ssh; ln -sf /workspace/.ssh $HOME/.ssh

This will persist your ~/.ssh dir on re-launch.

Also, you can utilize the dotfiles1 install.sh if you want to avoid doing this for each and every repo via .gitpod.yml.
And in fact, you can save your ssh keys as an env var on https://gitpod.io/variables and use that to configure them for each workspace via scripting install.sh of the dotfiles feature. Although I wouldn't recommend you doing so.

Footnotes

  1. https://www.gitpod.io/docs/config-dotfiles

@0xJem
Copy link
Author

0xJem commented Feb 4, 2022

Thanks all for the feedback/suggestions!

Not entirely comfortable putting SSH keys into the variables, so the before task will have to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants