blogng/blog/2019-02-13-ssh-tricks.markdown
2019-02-14 10:50:48 -05:00

1.8 KiB

layout title date comments tags
post SSH Tricks 2019-02-13 true ssh, shell

SSH is omnipresent, and more or less standard in connecting to remove machines. Even windows is shipping it. These are some less known (IMHO), but cool SSH features.

This is more of a whats possible list, rather how to though.

  1. If you have to ssh to machines only accessible from another control machine, try -J flag. ssh -J control_machine actual_machine (more details man ssh)
  2. GnuPG keys can also be your ssh key: There is no reason to maintain two sets of keys, you can use your gpg keys are ssh keys. Arch wiki has a nice explanation.
  3. If you do use gpg keys, you can store them on a Yubikey or any supported hardware keys. This ensures your keys are accessible only when they are plugged it, quite useful if you move around computers a lot.
  4. You can shorten your complicated ssh commands by adding an entry in ~/.ssh/config file. more details (also see man ssh_config)
  5. If you want to lend your SSH key to a host you ssh to (to ssh from the guest to somewhere else, git clone from github etc) - try the -A flag.
  6. SSH can act as a web proxy to fetch requests via your server - quite handy as a quick and dirty vpn. Emphasis on quick n dirty - don't use this to replace a regular vpn.
  7. SSH can act as a full fledged VPN (see -w flag)
  8. SSH can create a reverse shell, useful if you want to expose a machine behind NAT outside.