MathHubInfo / Legacy-localmh

DEPRECATED - A cross-repository administration tool for the local authoring in MathHub.info
1 stars 0 forks source link

ssh config owner problem. #299

Closed kohlhase closed 8 years ago

kohlhase commented 8 years ago

When I lmh pull, I get the following error.

Michaels-MacBook-Pro:TopModCS kohlhase$ lmh pull
Starting update:            '/mounted/lmh/MathHub/MiKoCourses/TopModCS/'
Running pre-update hook for '/mounted/lmh/MathHub/MiKoCourses/TopModCS/' ... Done. 
Running git pull ...
Bad owner or permissions on /root/.ssh/config
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Failed (merge conflicts or network issues?)
Running post-update hook for '/mounted/lmh/MathHub/MiKoCourses/TopModCS/' ... Done. 
Update failed:              '/mounted/lmh/MathHub/MiKoCourses/TopModCS/'
Re-installing updated repositories ...

The cause for this seems to be that I had to use ~/.ssh/config, which needs to have "me" as an owner and permission 600. But from inside docker this translates to the permission

Michaels-MacBook-Pro:Figures kohlhase$ lmh core shell 
root@hostname:/Users/kohlhase/localmh# ls ~/.ssh/config 
/root/.ssh/config
root@hostname:/Users/kohlhase/localmh# ls -l ~/.ssh/config 
-rw------- 1 1000 staff 123 Mar  1 19:42 /root/.ssh/config
root@hostname:/Users/kohlhase/localmh# whoami
root

which causes the problem.

I can work around this, but it would be nice to see this fixed.

kohlhase commented 8 years ago

I remember that there was a command for copying over the dotfiles, maybe redoing that helps.

tkw1536 commented 8 years ago
lmh docker stop
lmh docker delete
lmh docker create

SHOULD take care of this (it worked for me last time I checked, but I can try again).

kohlhase commented 8 years ago

actually it doesn't same error.

tkw1536 commented 8 years ago

@kohlhase Can you try running

echo -e "Host gl.mathhub.info\n\tStrictHostKeyChecking no\n" >> $HOME/.ssh/config

inside lmh docker shell ?

Any other solution I can think of would involve either copying ssh keys inside the docker (not really secure) or using bindfs (which could be very slow).

kohlhase commented 8 years ago

unfortunately that does not help either. I suspect that it complains first and then finds out later that it should not complain.

tkw1536 commented 8 years ago

ok, I have pushed the bindfs solution to the dev branch of localmh_docker. It is entirely untested.

Can you pull that branch, do

lmh docker stop
lmh docker start

and try again?

kohlhase commented 8 years ago

no progress unfortunately

tkw1536 commented 8 years ago

They need to be root owned inside docker. I have run the fix. Can you try again?

kohlhase commented 8 years ago

let's just debug this together when you next come in.