kasmtech / workspaces-core-images

https://www.kasmweb.com
Other
328 stars 117 forks source link

Persistent Profiles and ssh keys #10

Closed j-simmons-phd closed 2 years ago

j-simmons-phd commented 2 years ago

I have been testing out persistent profiles and noticed that ssh keys were not persisting for me. Upon investigation, I observed that my ssh keys were being stored under /home/ubuntu/.ssh and not /home/kasm-user/.ssh which would explain why turning on persistent profiles is not persisting my ssh keys.

It also looks like there are a couple of other dot directories in use under /home/ubuntu/. Would it be possible to ensure all of these dot directories are accessed from under /home/kasm-user/?

Thanks.

mmcclaskey commented 2 years ago

Kasm can manage user SSH keys, with or without persistent profiles enabled. In the Kasm admin panel, go to groups, click view All Users, go to group settings and add "inject_ssh_keys" and set to true. By default, Kasm will randomly generate SSH keys for users. You can go to your personal profile to download the public key or upload your own key pair.

Can you provide the steps you used to generate the key that resulted in it going to /home/ubuntu?

j-simmons-phd commented 2 years ago

While logged into the workspace, I was following directions provided by GitHub to create an ssh key for use when working from the workspace. These are pretty common instructions for my use cases, and I would like users to be able to manage their keys like they do on physical machines when persistent profiles are enabled.

The actual command that reproduces the issue is: ssh-keygen -t ed25519 -C "<user-email-address>"

This command was pulled from https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Thank you for your quick response.

mmcclaskey commented 2 years ago

I was not able to duplicate, which image are you using, this was using the kasmweb/ubuntu-bionic-desktop image

image

j-simmons-phd commented 2 years ago

I have been using the kasm-core-nvidia dockerfile to create my images from. Upon investigation, I see that this dockerfile adds an ubuntu user to the container. After updating my dockerfile to remove that part of the build, things seem to be working. I imagine this is part of why there is not a focal-core image posted yet.

Thanks for the help.