Update pinchot.md - Jenna's Addition - #105
Conversation
adds Jenna's additions on ssh, ssh-keys, ssh Proxy jumps, tmux
|
|
||
| ssh keys allow you to securely login to a remote machine without typing a password. It's best practice to create separate ssh keys for each remote machine, so we'll create a new ssh key with: | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
Can these instructions just point to https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?
There was a problem hiding this comment.
I can tie them into a hyper link in the ssh-key section? Or is it more for brevity?
There was a problem hiding this comment.
yes they could, but I would recommend against it. I think inline and opinionated documentation is more effective for onboarding new people (who may have wildly varying backgrounds in ssh, networking, or practical asymmetric cryptography), which would seem to be the main use for this document.
Additionally the link you provided is for using ssh keys for a different purpose, as a result it encrypts them and uses an ssh agent. Given that full disk encryption is the default for modern windows and macos, and generally used by competent linux users on devices not held in secure locations, I think plaintext private keys are acceptable for most threat models.
Because of this I deliberately chose a path that avoids the use of an ssh-agent because i personally (and i acknowledge this is simply an opinion) find them to be clunky and annoying.
If you feel strongly that ssh keys should be encrypted, this section could be re-written to incorporate that along with ssh-agent instructions, but i'd still recommend inline documentation. The extra half a kilobyte of data which contains the specifics to help someone with less ssh experience is a reasonable tradeoff in my opinion.
| ssh pinchot | ||
| ``` | ||
|
|
||
| ### persistent ssh sessions with tmux |
There was a problem hiding this comment.
Can you restructure this section to also discuss the nohup command? This is another way you can run commands in the background even if your ssh connection drops and isn't specific to the tmux terminal emulator.
There was a problem hiding this comment.
I'll give it a shot!
There was a problem hiding this comment.
Can you restructure this section to also discuss the
nohupcommand?
While I can see the relevance of the nohup command, I'd recommend against it because it doesn't support interacting with the detached process once the connection terminates, which will likely result in process pollution and/or the need to kill orphaned processes. As a result, I feel like covering it would likely add unneeded technical details on how POSIX signals work, which seems outside of scope for this document and/or confuse/mislead people about best practices for managing detached processes.
...and isn't specific to the tmux terminal emulator.
tmux is a terminal multiplexer, not a terminal emulator, and is terminal emulator (and shell) agnostic, so long as it supports vt100 escape codes (ie. any terminal emulator from the last 40+ years). If you want to discuss other comparable options, I would suggest GNU screen as another option for detachable, and critically reattachable, hangup resistant sessions.
|
|
||
| ``` | ||
| coreform_cubit | ||
| coreform\_cubit |
There was a problem hiding this comment.
why is the backslash needed? It renders fine in markdown
There was a problem hiding this comment.
not needed, its an escape character for underlines, is a quirk I can remove.
modifies ssh key description Co-authored-by: April Novak <[email protected]>
Added github ssh link, nohup description, removed some escape characters.
Ex-32
left a comment
There was a problem hiding this comment.
I appreciate the feedback, I don't agree with all of your suggestions, and so I've added my thoughts, I would appreciate a response as soon as you have the time.
| ### ssh keys | ||
|
|
||
| ssh keys allow you to securely login to a remote machine without typing a password. It's best practice to create separate ssh keys for each remote machine, so we'll create a new ssh key with: | ||
| ssh keys allow you to securely login to a remote machine without typing a password. ssh keys are also needed if you want to push/pull with a remote git repository via the ssh protocol. It's best practice to create separate ssh keys for each remote machine, so we'll create a new ssh key with the following (run this on Pinchot, for instance): |
There was a problem hiding this comment.
I would highly recommend you do not use the same ssh key for login and git credential, I personally prefer using HTTPS API tokens for github, but even if you're going to use ssh, it really should be a dedicated key.
I also feel like the last parenthetical muddies the water a bit in being clear about where ssh keys for login should be placed. I think "github auth with ssh" should be it's own section.
Ex-32
left a comment
There was a problem hiding this comment.
I noticed one other misplaced escape code, i think my editor or the renderer i used to preview this might've added them
| ssh-copy-id -i ~/.ssh/pinchot_ed25519 <NetID>@pinchot.npre.illinois.edu | ||
|
|
||
| # Windows (PowerShell) | ||
| Get-Content \~\\.ssh\\pinchot_ed25519.pub | ssh <NetID>@pinchot.npre.illinois.edu "cat >> \~/.ssh/authorized_keys" |
There was a problem hiding this comment.
| Get-Content \~\\.ssh\\pinchot_ed25519.pub | ssh <NetID>@pinchot.npre.illinois.edu "cat >> \~/.ssh/authorized_keys" | |
| Get-Content ~\.ssh\pinchot_ed25519.pub | ssh <NetID>@pinchot.npre.illinois.edu "cat >> ~/.ssh/authorized_keys" |
adds Jenna's additions on ssh, ssh-keys, ssh Proxy jumps, tmux