Skip to content

Ssh

Generate key pair

cd ~/.ssh
ssh-keygen -t ed25519 -C "HostName"
  1. Private key id_ed25519 & Public id_ed25519.pub

  2. cat id_ed25519.pub add to string to ~/.ssh/authorized_keys on host machine

Migration / new machine

  1. Give full control of the .ssh directory to you only chmod 700 ~/.ssh

  2. Make the private key readable/writable ONLY by you chmod 600 ~/.ssh/id_ed25519

  3. Make the public key readable by everyone, writable only by you chmod 644 ~/.ssh/id_ed25519.pub

  4. using tmux for persistent session

  5. tmux new -s mysession

  6. Detach from the session by pressing Ctrl + B, releasing, and then pressing D
  7. check on it later: `tmux attach -t mysession'

  8. alternatively nohup

github multi accounts set up

~/.ssh/config

# sebdocs

Host github-sebdocs
HostName github.com
User git
IdentityFile ~/.ssh/github-sebdocs
IdentitiesOnly yes

tmux for picking up remote sessions

  1. Install tmux on server brew install tmux
  2. Allow mouse scroll tmux set -g mouse on
tmux new -s task
# Detach session
Ctrl + b
d
tmux ls
tmux attach -t task
  • Single command — create session “work” if it doesn’t exist, otherwise attach to it
tmux new -As work