Issue
So my question is this,
When creating a notebook in Sagemaker
AWS
I need to help the devEngineer keep his secret key in .ssh/id_rsa
as the file after every instance reboot becomes empty.
He requires a github
repo to be downloaded and he has to work on the code and then push the updates as needed.
Please let me know what details I need to provide to help you help me.
Thanks.
Solution
This is the filesystems for my notebook instance:
sh-4.2$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 76K 16G 1% /dev
tmpfs 16G 0 16G 0% /dev/shm
/dev/nvme0n1p1 94G 76G 19G 81% /
/dev/nvme1n1 99G 40G 55G 43% /home/ec2-user/SageMaker
Note that one pointing to /home/ec2-user/SageMaker
is the only one which is saved between reboots. Since ssh keys are stored in /home/ec2-user/.ssh
, they are lost after reboot.
The way I make it work is:
- Create the folder
/home/ec2-user/SageMaker/.ssh
- Run
ssh-keygen
and set the location/home/ec2-user/SageMaker/.ssh/id_rsa
- Clone repo with
GIT_SSH_COMMAND="ssh -i ~/SageMaker/.ssh/id_rsa -F /dev/null" git clone git@domain:account/repo.git
- cd repo
- Set your repo to use the custom location with
git config core.sshCommand "ssh -i ~/SageMaker/.ssh/id_rsa -F /dev/null"
Based on https://superuser.com/a/912281
Answered By - Wellington Gomes
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.