ls -al ~/.ssh
If you receive an error indicating that ~/.ssh
does not exist, you do not have an SSH key pair at the default location.
ssh-keygen -t ed25519 -C "[email protected]"
If you are using a legacy system that does not support the Ed25519 algorithm, use:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Start the SSH agent in the background.
eval "$(ssh-agent -s)"
Add your SSH private key to the SSH agent.
ssh-add ~/.ssh/<ssh_key>
ssh-keygen -f ~/.ssh/known_hosts -R <ip>
ssh-copy-id <user>@<host>
ssh <user>@<host>
ssh -L <local_port>:<remote_host>:<remote_port> <user>@<host>
ssh -R <remote_port>:<local_host>:<local_port> <user>@<host>
ssh <user>@<host> '<command>'
ssh -T <user>@<host>