
y must come before -f input_keyfile, else you will get the error Too many arguments.If you've purchased a new PC with Windows pre-installed in the past few years, you might have noticed a few changes on the outside of the device. Note that the order of arguments is important. Ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLinxx9T4HE6Brw2CvFacvFrYcOSoQUmwL4Cld4enpg8vEiN8DB2ygrhFtKVo0qMAiGWyqz9gXweXhdmAIsVXqhOJIQvD8FqddA/SMgqM++2M7GxgH68N+0V+ih7EUqf8Hb2PIeubhkQJQGzB3FjYkvRLZqE/oC1Q5nL4B1L1zDQYPSnQKneaRNG/NGIaoVwsy6gcCZeqKHywsXBOHLF4F5nf/JKqfS6ojStvzajf0eyQcUMDVhdxTN/hIfEN/HdYbOxHtwDoerv+9f6h2OUxZny1vRNivZxTa+9Qzcet4tkZWibgLmqRyFeTcWh+nOJn7K3puFB2kKoJ10q31Tq19 Note that there is no prompt for the passphrase, the public key will be displayed, and the exit status ( $?) will be 0 to indicate success: $ ssh-keygen -y -f /tmp/my_key_with_no_passphrase Note that the "load failed" error message will be displayed (message may differ depending on OS) and the exit status ( $?) will be 1 to indicate an error: $ ssh-keygen -y -f /tmp/my_keyĪttempt to access a key pair that has no passphrase. Ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJhVYDYxXOvcQw0iJTPY64anbwSyzI58hht6xCGJ2gzGUJDIsr1NDQsclka6s0J9TNhUEBBzKvh9nTAYibXwwhIqBwJ6UwWIfA3HY13WS161CUpuKv2A/PrfK0wLFBDBlwP6WjwJNfi4NwxA21GUS/Vcm/SuMwaFid9bM2Ap4wZIahx2fxyJhmHugGUFF9qYI4yRJchaVj7T圎mquCXgVf4RVWnOSs9/MTH8YvH+wHP4WmUzsDI+uaF1SpCyQ1DpazzPWAQPgZv9R8ihOrItLXC1W6TPJkt1CLr/YFpz6vapdola8cRw6g/jTYms00Yxf2hn0/o8ORpQ9qBpcAjJNĪttempt to access the key pair by inputting an incorrect passphrase. Note that the public key will be shown and the exit status ( $?) will be 0 to indicate success: $ ssh-keygen -y -f /tmp/my_key Your public key has been saved in /tmp/my_key.pub.ĭe:24:1b:64:06:43:ca:76:ba:81:e5:f2:59:3b:81:fe key's randomart image is:Īttempt to access the key pair by inputting the correct passphrase. Your identification has been saved in /tmp/my_key. Now see if you can access the key pair: $ ssh-keygen -y -f /tmp/my_keyįollowing is an extended example, showing output.Įnter passphrase (empty for no passphrase): If the key has no passphrase, it will not prompt you for a passphrase and will immediately show you the associated public key.Ĭreate a new public/private key pair, with or without a passphrase: $ ssh-keygen -f /tmp/my_key If you input the wrong passphrase, it will display load failed.


If you input the correct passphrase, it will show you the associated public key. Ssh-keygen -y will prompt you for the passphrase (if there is one).
