ssh-keygen -t rsa -a 100 -b 8192
ssh-keygen -t ed25519 -a 100
- touch required 1
ssh-keygen -t ed25519-sk -C "Yubi-W"
ssh-keygen -t ed25519-sk -O resident -O verify-required -C "Yubi-SB"
ssh-keygen -vl -f privkey
ssh-keygen -y -f privkey > pubkey
ssh-keygen -p -f privkey
# This operation overwrites the privkey file
cp privkey privkey.openssh
ssh-keygen -p -N "" -m pem -f privkey
You're not really using Windows, right? This is for your less-fortunate acquaintances.
ssh-keygen -e -m RFC4716 -f pubkey > pubkey.otherformat
In this example:
- Host A: Linux system running sshd
- Host B: Linux system running MariaDB; accessible only from the network Host A is on
- Laptop C: Client laptop
# Start port forwarding
[baz@laptop-c ~]$ ssh -Llocalhost:9090:host-b:3306 baz@host-a
# Connect to MariaDB using laptop client software
[baz@laptop-c ~]$ mysql -h localhost -P 9090 -u dba -p
In this example:
- Host A: Linux system running sshd
- Laptop B: Client laptop
# Start dynamic port forwarding
[baz@laptop-b ~]$ ssh -D localhost:8080 -C baz@host-a
Then configure web browser to use proxy.
- Select "Manual proxy configuration"
- Enter "SOCKS Host" values of: localhost, port 8080
- Do not select "Use this proxy server for all protocols"
- Leave the other Proxy input boxes blank
- Select "SOCKS v5"
- Select "Proxy DNS when using SOCKS v5"
(Now that the proxying is set up, all HTTP - and DNS - requests through the browser will be forwarded over SSH, through host-a, then on to their destination.)
Allows shell access to a system that is behind a NAT/PAT device. In this example:
- Host A: Linux system running sshd; on private LAN, behind NAT device
- Host B: Linux system running sshd; accessible from anywhere
# Start reverse tunnel
[foo@host-a ~]$ ssh -R 6900:localhost:22 bar@host-b
# Connect to "unreachable" system through reverse tunnel
[bar@host-b ~]$ ssh foo@localhost -p 6900
Footnotes
-
For SSH keys that are created with a FIDO authenticator, a passphrase may not be very useful. Instead, private key access can be managed using the physical device (with either touch or a PIN). ↩ ↩2
-
FIDO example with resident credentials derived from Yubikey article. ↩