Custom username #43591
-
Select Topic AreaQuestion BodyI'm banging my head on this one. I'm trying to have the codespace environment mimic as close as possible the environment a student would see in a "real world" environment. And make their assignments as "uncopypasteable" as possible. As such, I'm trying to get their usernames to match their github usernames. I've gotten this to work using the Common Utils feature and setting the username to ${localEnv:GITHUB_USER} and then further setting remoteUser to the same. BUT, this doesn't work if you prebuild the container, as GITHUB_USER is not set during prebuild and the "features" are baked into the images. So I thought to use one of the lifecycle scripts. But these all run as the user you have set as "remoteUser". Chicken and egg. I CAN create the user in an onCreateCommand, but I can't then connect as that user. Can you think of any way to prebuild AND connect as a customized user? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi! Thank you for writing in! You are correct that your current setup using features will only work without prebuilds since you're prebuilding in order to mitigate the wait on the features install for the user. Are you just trying to set the username to have it shown in the bash prompt? Or do you actually want a user on the box with that name? Also, are you using the default image? Or providing a custom image? |
Beta Was this translation helpful? Give feedback.
Hi! Thank you for writing in!
You are correct that your current setup using features will only work without prebuilds since you're prebuilding in order to mitigate the wait on the features install for the user. Are you just trying to set the username to have it shown in the bash prompt? Or do you actually want a user on the box with that name?
Also, are you using the default image? Or providing a custom image?