DS‐ Git Linux SSH Script - 229300/SYS265-System-Admin.-Network-Services-II---Spring-2026 GitHub Wiki
Install git on docker01
- Run this command on docker01
- sudo apt install git
- Looks like:
Git clone
Create a directory Structure
- Install tree command:
- sudo apt install tree -y
- Looks like:
Change Directories to SYS265-V2
- cd SYS265-V2
- Type: tree
- Looks like:
- mkdir -p DockerProject/nginx
- touch DockerProject/docker-compose.yml
- touch DockerProject/nginx/Dockerfile
- touch DockerProject/nginx/nginx.conf
- tree
- Looks like:
- cd DockerProject
- echo "docker01 configuration" >> README.md
- ls
- git add .
- git status
- Looks like:
Warning DO THIS BEFORE PROCEEDING
Go to the github (in this case- SYS265-V2) Go to Settings --> Scroll down to Developer Finish --> Personal Access Tokens --> Tokens (classic) --> Generate New Token --> Generate new token (classic) --> Note: SYS265-V2 --> Expiration: Whenever --> check every box except the ones with "delete" --> Generate token
Back on track now
-
git config user.email [email protected]
-
git config user.name 229300
-
git commit -m "Added a README"
-
git push
-
Prompted for username and password
-
Username: 229300
-
Password: [Token Generated Before found in my doc]
-
Looks like:
Deliverable 1:
Git Clone
- cat README.md
- rm README.md
- git checkout .
- cat README.md
Deliverable 2:
Git on Windows
Install the 64-bit version of Git on mgmt01 using defaults
- Navigate to mgmt01 VM
- Search "Git on Windows":
-
Open the file and config using default settings
-
Only thing I changed was adding the icon on my desktop everything else default:
- Installing:
- Once Open:
- cd Desktop
- git clone https://github.com/229300/SYS265-V2
- Looks like:
Modify your repo
Create a mgmt01 directory with a README.md file with some irrelevant content
- mkdir mgmt01
- The following commands to do:
- git add .
- git status
- git config user.email [email protected]
- git config user.name 229300
- git commit -m "Added a README to mgmt01"
- git push
- Looks Like:
Deliverable 3.
Oops! the intent was to paste the actual hostname in the README file. Figure out the correct use of echo to make it happen
- echo $(hostname) >> README.md
- nano README.md
- Delete "hostname" keep the new input
- git add .
- git status
- git commit -m "oops"
- git push
- Looks like:
Deliverable 4.
Git Pull
Now the local repository on docker01 is out of sync with the online version because of the push from mgmt01 that is not reflected in the local repo on docker01. Let's sort that out.
- Back on docker01
- Do these commands:
Deliverable 5.
Part 2: Hardening SSH
You will need to install Git. Then clone the repository to web01.
- On web01 VM
- sudo dnf install git -y
- git clone https://github.com/229300/SYS265-V2
- Looks like:
Let's organize our local repository a bit and then push the changes up to Github. We are going to create a few directories and a shell script called secure-ssh.sh
-
Do these commands:
-
nano centos7/secure-ssh.sh
-
Type the following:
- Do these commands:
Push changes to github
- Looks like:
Deliverable 6.
RSA keypair
Create an RSA Keypair on web01, with no passphrase required. Copy the PUBLIC key to the local repo, see the last two lines
- Should be in linux directory
- cd public-keys/
- Do these commands:
- Do these commands:
Deliverable 7.
Hardening Script
On docker01, pull to synchronize your repo
- Navigate to docker01
- Do these commands:
- Then do these commands:
- Time to test manual config web01 --> docker01
- Navigate to docker01 real quick and do these commands:
- Navigate to web01:
- ssh sys265@docker01-daniel