Skip to content

Instantly share code, notes, and snippets.

@jdmichaud
Last active September 3, 2024 14:48
Show Gist options
  • Save jdmichaud/92970a2aadc19501ee96762416ef5551 to your computer and use it in GitHub Desktop.
Save jdmichaud/92970a2aadc19501ee96762416ef5551 to your computer and use it in GitHub Desktop.
SSH tips

Config

Create an alias

$ cat >> ~/.ssh/config
Host <ALIAS_NAME>
  HostName 1.2.3.4
  User jd

Authentication

To add your public key to a server:

ssh-copy-id -p <PORT> -i ~/.ssh/id_rsa.pub <REMOTE_USER_NAME>@<IP_ADDRESS_OF_THE_SERVER>

Mount folder through ssh

mkdir -p <MOUNT_POINT>
sshfs -p <PORT> <USER>@<HOSTNAME>:<PATH> <MOUNT_POINT>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment