Since files in $HOME aren’t persistent, how do you setup custom rc files for interactive shells.
I launch my instances with a persistent FS mounted under $HOME/my_cool_stuff
Cheers
Since files in $HOME aren’t persistent, how do you setup custom rc files for interactive shells.
I launch my instances with a persistent FS mounted under $HOME/my_cool_stuff
Cheers
Answering my own question with the help of Claude…
Prior to logging into your instance for the first time, create a symlink that points “${HOME}/.bash_profile” to your desired bashrc
Scripted like this… Export LAMBDALABS_INSTANCE and LAMBDALABS_MOUNT on your pc to suit.
# 1. Create a .bash_profile symlink on the running instance iff needed
ssh "$LAMBDALABS_INSTANCE" "bash -c '[[ ! -e \"\${HOME}/.bash_profile\" && ! -L \"\${HOME}/.bash_profile\" ]] && ln -s \"\${HOME}/${LAMBDALABS_MOUNT}/bashrc\" \"\${HOME}/.bash_profile\"'"
# 2. Login normally
ssh "$LAMBDALABS_INSTANCE"