Public and private key pair can be created and used for publickey
authentication method in SSH
. During the SSH
key pair creation process you have the option to whether or not assign passphrase
to the private key.
A key without passphrase
would allow passwordless login to SSH
servers whereas if passphrase
is assigned, you'll need to key in the passphrase
during the publickey
login process.
This can be changed after the fact as you can still add, edit or remove the passphrase
on your existing SSH
private key using ssh-keygen
.
Methods to manage passphrase of an SSH
key.
ssh-keygen
with -p
option. $ ssh-keygen -p
SSH
private key. Enter file in which the key is (/home/user/.ssh/id_rsa):
Default location is selected by default
Key has comment '[email protected]'
Enter new passphrase (empty for no passphrase): Enter same passphrase again:
Your identification has been saved with the new passphrase.
ssh-keygen
with -p
option . $ ssh-keygen -p
SSH
private key. Enter file in which the key is (/home/user/.ssh/id_rsa):
Default location is selected by default
Enter old passphrase:
Key has comment '[email protected]'
Enter new passphrase (empty for no passphrase): Enter same passphrase again:
Your identification has been saved with the new passphrase.
ssh-keygen
with -p
option . $ ssh-keygen -p
SSH
private key. Enter file in which the key is (/home/user/.ssh/id_rsa):
Default location is selected by default
Enter old passphrase:
Key has comment '[email protected]'
[ENTER]
twice without entering any passphrase to remove current passphrase. Enter new passphrase (empty for no passphrase): Enter same passphrase again:
Your identification has been saved with the new passphrase.
Comment anonymously. Login not required.