SSH: Secure Shell or Secure Socket Shell
- Encrypted connection between two hosts over the internet
- SSH key pair:
- Public Key : id_
.pub eg. id_rsa.pub - Private Key: id_
- Public Key : id_
Q. How to generate an SSH Key pair?
- Use any one algorithm below:
$ ssh-keygen -t rsa -b 4096 $ ssh-keygen -t ecdsa -b 521 $ ssh-keygen -t ed25519
- Select the default location and filename. (or, you can choose your own) : eg. .ssh/id_rsa.pub
- You are then prompted to enter a passphrase. (Choose a strong one) (Dont want a passphrase? => Just press ENTER)
-
Now, copy the public key to the server! Thats it!
- Note: 1. If you change the default name of the key pair, then you have to explicitly specify that this key should be used for connecting to a specific host.
$ ssh -i ~/
/ username@servername 2. For frequent users, you can configure ssh. $ ~/.ssh/config 3. If error, debug using: $ ssh -v