> For the complete documentation index, see [llms.txt](https://paul-gleason.gitbook.io/sys-265-system-admin.-and-network-services-ii/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paul-gleason.gitbook.io/sys-265-system-admin.-and-network-services-ii/labs/lab-3.0-git-and-ssh-keys.md).

# Lab 3.0: Git & SSH keys

### Summary

This lab was very straightforward and a very nice review of git and ssh keys. It's funny to me with the SSH keys because I have done this a few times before when setting up reverse ssh on campus so I can host my website and other utils. I will say the hardest part of this lab was the script just because the wording on it was a little funny but, once I asked a classmate I was rolling at Mach-5

### Git

* `git clone <url>` clones repo to current location
* `git commit` commits current changes to repo
  * `git commit -m <message>` will change update message in repo after push
* `git push` pushes changes that have been committed to the repo
* `git add .` adds current directory to repo
* `git pull` pulls all updates from repo
* `git checkout` checks for updates in the repo

### SSH

* `ssh-keygen -t rsa -C "<user>"` will generate a public and private rsa key pair
  * these keys will be default saved in `/home/<user>/.ssh/id_rsa`
  * THE PUBLIC KEY SAYS id\_rsa.pub NEVER SHARE PRIVATE KEY!!!!!
* For password less entry to another system
  1. copy the public key over to the `/home/<user>/.ssh/authorized_keys`
  2. `chmod 700 /home/<user>/.ssh`
  3. `chmod 600 /home/<user>/.ssh/authorized_keys`
  4. `shown -R <user>:<user> /home/<user>/.ssh`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://paul-gleason.gitbook.io/sys-265-system-admin.-and-network-services-ii/labs/lab-3.0-git-and-ssh-keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
