ssh use key code example
Example 1: ssh generate key
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Example 2: ssh with key
ssh -i ~/.ssh/id_rsa.pub [email protected] -p25
Example 3: ssh key
ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id_ed25519.pub | clip
Example 4: create ssh keys
cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys"
Example 5: SSH key
$ clip < ~/.ssh/id_ed25519.pub
# Copies the contents of the id_ed25519.pub file to your clipboard