From b9bddc179ad7b6fa43feb23e2ac83210061a364a Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Wed, 13 Aug 2025 19:12:46 +0300 Subject: [PATCH] completed ssh sec, added git --- _subsections/lesson-05.org | 54 ++++++++++++++++++++++++++++++++++++++ _subsections/lesson-06.org | 34 ++++++++++++++++++++++++ toc.org | 1 + 3 files changed, 89 insertions(+) create mode 100644 _subsections/lesson-06.org diff --git a/_subsections/lesson-05.org b/_subsections/lesson-05.org index 1977a6a..8073e36 100755 --- a/_subsections/lesson-05.org +++ b/_subsections/lesson-05.org @@ -289,3 +289,57 @@ you can find good alias lists online ├─ bashrc └─ vimrc #+end_src + +** ssh +- working with remote machines +- it is good for opening connections +- can execute commands remotely, and piping back the output to the calling shell + ~ssh username@some-ip.com ls -la~ + +** ssh keys +- typing passwords is inconvenient +- use public key encryption + - public, private + - give public key to the server + - whenever you try to authenticate use your private key + +*** create a key +~ssh-keygen -o -a -t ed25519~ + +- passphrase gives extra protection bc a user of the private key has to give a password + +- creates + - private key: id_ed25518 + - public key: id_ed25519.pub + +*** move the public key to the server +#+begin_src bash +cat ~/.ssh/id_ed25519.pub | ssh username@ip-address.com tee .ssh/authorized_keys +#+end_src + +- at that point ssh will ask you for the password for the server and then it will put the key where you sent it +- 'tee' sends standard input both to the screen and to a file (so you can see what is being saved) + +**** ssh-copy-id +- does the above but in one command +~ssh-copy-id username@ip-address~ + + +** copy files remotely +*** scp +~scp filename.ext username@ip-address:/path/to/new-filename.ext~ + +*** rsync +- copy a LOT of files remotely +- rsync can continue from interrupts + + +~rsync -avP /folder/to/copy/from username@ip-address:/folder/to/copy/to~ + +** ssh config + +Host hostname + User username + HostName ip-address + IdentityFile ~/.ssh/id_ed25519 + RemoteForward 9999 localhost:8888 diff --git a/_subsections/lesson-06.org b/_subsections/lesson-06.org new file mode 100644 index 0000000..b073342 --- /dev/null +++ b/_subsections/lesson-06.org @@ -0,0 +1,34 @@ +#+title: Lesson 06 | Version Control (git) +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+OPTIONS: H:6 + +* Links +#+attr_html: :class links +- [[../toc.org][TOC | Missing Semester]] +- [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]] +- [[https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbFlfYnViTXFoZm9UUXlSVVJEU0VFUkNKZ3BXd3xBQ3Jtc0tuVlVvNktsdnI1Tlh2NlYtUGpteFRWZE03R2dzRTdldklNZldKaVh4REtTNzRYcUJheXV6S3ZuQWV6c2x0RzhRYjdmMmdhWXVwamt2TWRPYkd3cW8yTFBJNEpJYVc1elFCX09mdDgxRlc3bW50UjlVQQ&q=https%3A%2F%2Fmissing.csail.mit.edu%2F2020%2Fversion-control%2F&v=2sjqTHE0zok][class notes]] + +- Curr: https://youtu.be/2sjqTHE0zok?si=--BTpZVvln-Og5t0 + +*** timestamps +:PROPERTIES: +:CUSTOM_ID: timestamp +:END: + +#+attr_html: :class playlist ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok][00:00 - Office Hours]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=48s][00:48 - Version Control Systems]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=415s][06:55 - Adhoc Version Control]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=470s][07:50 - Git Models]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=900s&pp=0gcJCd0CDuyUWbzu][15:00 - Data Structure]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=1502s][25:02 - Questions]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=1587s][26:27 - Demo]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=1755s][29:15 - Staging Area]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=2092s][34:52 - Git Log]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=2826s][47:06 - Branching Merge]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=3008s][50:08 - Branching Cat]] ++ [[https://www.youtube.com/watch?v=2sjqTHE0zok&t=3177s][52:57 - Branching Dog]] + +* notes diff --git a/toc.org b/toc.org index 0ddbae2..8d55dc5 100755 --- a/toc.org +++ b/toc.org @@ -34,3 +34,4 @@ - [[./_subsections/lesson-03.org][Lesson 03 | Editors (vim)]] - [[./_subsections/lesson-04.org][Lesson 04 | Data Wrangling]] - [[./_subsections/lesson-05.org][Lesson 05 | Command-line Environment]] +- [[./_subsections/lesson-06.org][Lesson 06 | Version Control (git)]]