Why configure it

  • The goal is to type sky or ssh sky instead of repeatedly specifying username, host, and PEM key. 35:27
  • The same setup also supports uploading and downloading files between the local machine and the server. 35:27
  • The speaker frames this as a time saver for anyone working across multiple computers. 35:43

SSH config

  • Open or create ~/.ssh/config. 35:56
  • Add a Host sky entry with the server HostName, IdentityFile, and User ubuntu. 36:14 36:34 36:52
  • After that, ssh sky connects directly to the instance. 36:52

Shell helper

  • A shell function named sky is added to .zshrc on macOS/zsh or .bashrc on Bash systems. 37:14 37:31
  • If no argument is given, the function runs ssh sky. 38:38
  • If the first argument is upload, the function uses scp over SSH to upload a local file to the remote machine. 38:10 39:35
  • sky download uses the same source-then-destination pattern, with a default destination such as the local Downloads folder. 39:58 40:37
  • After editing the shell configuration, the file must be sourced so the new function is available in the current terminal. 39:13

VS Code Remote SSH

  • VS Code can connect to the same sky host through the Remote SSH UI because it reads the SSH config entry. 41:36
  • Once connected, VS Code can open folders such as the Weer project on the remote server. 41:53
  • The speaker demonstrates editing a remote README from local VS Code and confirming the change through SSH. 42:29
  • This workflow will later make remote configuration files, including NGINX files, easier to edit. 42:53

Generalization

  • The same SSH shortcut pattern works for other machines, including a local MacBook on the network. 43:07 43:30