Q. How do I change OpenSSH passphrase for one of my private keys under Linux?
A. Use ssh-keygen command to generates, change manages and converts authentication keys for ssh. Generally, you should the see following files at $HOME/.ssh (~/.ssh directory i.e. /home/you/.ssh/)
=> id_dsa : DSA authentication identity of the user
=> id_dsa.pub : DSA public key for authentication
=> id_rsa : RSA authentication identity of the user
=> id_rsa.pub : RSA public key for authentication
Changing a Passphrase with ssh-keygen
The -p option requests changing the passphrase of a private key file instead of creating a new private key. The program will prompt for the file containing the private key, for the old passphrase, and twice for the new passphrase. Use -f {filename} option to specifies the filename of the key file. For example, change directory to .ssh:
$ cd .ssh
To change RSA passphrase, enter:
$ ssh-keygen -f id_rsa -p
To change DSA passphrase, enter:
$ ssh-keygen -f id_dsa -p
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 5 comments… read them below or add one }
If something relies on the private key will it still work the same way? I mean a SSL certificate for example…
thanx for the quick mem check
Thanks for this!
Thank applause and encouragement, for the valid reason that he offers me better power and courage!
change password key to best family ever