Do Good
Do Good

Reputation: 1315

how to generate public key from windows command prompt

I need to generate public key to set up in ssh. How do I do it from windows command prompt? I tried using ssh-keygen -t rsa from c:\ but received a message ssh-keygen is not recognized as an internal or external command, operable program or batch file.

Upvotes: 37

Views: 111010

Answers (4)

mico
mico

Reputation: 1926

Starting from Windows 10, there is a full implementation of openSSH, including ssh, scp and sftp in C:\Windows\System32\OpenSSH. It also is present in Windows Server, at list I can confirm it's present on Windows Server 2022. So, you do not need a download to go

ssh-keygen -t rsa

Upvotes: 0

TarkaDaal
TarkaDaal

Reputation: 19585

If you've got git-bash installed (which comes with Git, Github for Windows, or Visual Studio 2015), then that includes a Windows version of ssh-keygen.

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Upvotes: 9

Eduardo La Hoz Miranda
Eduardo La Hoz Miranda

Reputation: 2056

Just download and install openSSH for windows. It is open source, and it makes your cmd ssh ready. A quick google search will give you a tutorial on how to install it, should you need it.

After it is installed you can just go ahead and generate your public key if you want to put in on a server. You generate it by running:

ssh-keygen -t rsa

After that you can just can just press enter, it will automatically assign a name for the key (example: id_rsa.pub)

Upvotes: 15

chill0r
chill0r

Reputation: 1129

ssh-keygen isn't a windows executable.
You can use PuttyGen (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) for example to create a key

Upvotes: 19

Related Questions