this post was submitted on 13 Oct 2023
3 points (100.0% liked)

GIT - Github, Gitea, Gitlabs. Everything git

321 readers
2 users here now

A place to everything git!

Rules

Cross-posts

Sidebar updates soon!

founded 3 years ago
MODERATORS
 

hello! For University I need to use a remote machine with a very very VERY weak password I cannot change, and I have to use that machine to edit some code with a few other students of my team. All the code should then be pushed to a repo of my personal github. I'd like to be able to grant access to only that repo, so that if someone guesses the password it cannot touch my other stuffs. What options do I have?

[SOLVED] EDIT:
as suggested by @[email protected] I created a github fine grained access token setting its only permission as read/write only that repo. Then I cloned the repo on the remote machine and set the url to include the token:

git remote set-url origin https://myusername:[email protected]/myusername/myrepo.git 

I then set the user and email:

git config user.name myusername
git config user.email [email protected]

and voilà! I can now simply push without any password requested! And in case someone gained access to the token (that is stored in plain text inside the .git folder) it would only grant access to that specific repo, limiting the damages

you are viewing a single comment's thread
view the rest of the comments
[–] elliot_crane 2 points 1 year ago

Glad to hear, good luck with your project.