Git Linux SSH Script - michael-D-S/SYS-265 GitHub Wiki
Michael Sargent SYS-265-01, 2/15/2025
Git + Linux SSH Script ,Tech Journal
Overview:
Within this lab I set up my git repositories to link with my machines using git. I was also able to make a script to make a user that can log in without a password to easy access of machines, as well as made a private key to use with web01.
Trouble Shooting:`
- The main issue I had with the lab was authentication between GitHub and my docker01 machine, after some research i discovered that the issue was that git no longer supports a username and password authentication. I circumnavigated this issue by creating ssh key for the communication between GitHub and doecker01. See Making an SSH key and adding it to GitHub
- Another issue I had was making the script for the password less user login. The main issue I had was that my cp command was not able to find the proper file as it was in another directory and i could not figure out the path correctly. My solution was to curl the ssh key directly from my GitHub repository and make a temporary file and just cp from that temp file, and then delete it after I was done. That proved to be a much simpler thing and worked on the first try. (I have Perplexity to thank for helping me with the proper syntax for the commands.
**Git **
- git status: displays the state of the working directory and the staging area
- git add: adds a change in the working directory to the staging area
- git commit: save your changes to the local repository
- git pull origin main: downloads new code from the branch named master on the remote named origin and integrates them into your local HEAD branch.
- git push origin main: push the current branch to the branch of the matching name in the remote repository