SSH Helps

Tunnel to port on Mercury Client

  • ssh -L <local_port>:localhost:<host_port> <host>

  • e.g. ssh -L 8181:localhost:8080 root@172.26.142.102

SSH Config

Create or edit ~/.ssh/config

Create New SSH Key

Using ssh-keygen, this creates a key of type ED25519 with the comment "caleb.carlson@hpe.com"

[root@mawenzi-04 ~]# ssh-keygen -t ed25519 -C "caleb.carlson@hpe.net"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/root/.ssh/id_ed25519): /root/.ssh/caleb_id_ed25519
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/caleb_id_ed25519.
Your public key has been saved in /root/.ssh/caleb_id_ed25519.pub.
The key fingerprint is:
SHA256:lcDVKRifBA8/kqXOEilbUjovBtX5stABHSuXtOLBjJ0 caleb.carlson@hpe.net
The key's randomart image is:
+--[ED25519 256]--+
|    o+++==+. .   |
|   * ===o@.oo    |
|  o E.Oo+ O.     |
|   o.%o+.o .     |
|    =.ooS        |
|   . ...         |
|                 |
|                 |
|                 |
+----[SHA256]-----+

GitHub

Specify SSH IdentityFile to use for .git pulls/clones

# GitHub
Host github.com
  HostName github.com
  IdentityFile ~/.ssh/caleb_id_ecdsa

Wildcard Matching

Match anything that starts with mawenzi-0. Plug the full match into %h.

Host mawenzi-0*
  HostName %h.hpc.amslabs.hpecorp.net
  User root
  IdentityFile ~/.ssh/caleb_id_ecdsa