SSH – Common Usage

Connect to Target Host

# Usage: Default port is 22.
ssh [Target]

# Example:
ssh [email protected]

# Example: Connect with public key and different port.
ssh -i /home/olakari/olakari.rsa -p 2222 [email protected]

Copy Public Key to Target

# Usage:
ssh-copy-id -i [PrivateKey] [Target]

# Example:
ssh-copy-id -i /home/olakari/olakari.rsa [email protected]

Add Public Key to SSH Agent

# Usage:
ssh-add [PrivateKey]

# Example:
ssh-add /home/olakari/olakari.rsa 

Remove Public Key from SSH Agent

# Usage:
ssh-add [-D]|[-d] [PrivateKey]

# Example: Remove spesific key.
ssh-add -d /home/olakari/olakari.rsa

# Example: Remove all keys.
ssh-add -D