C:\Users\admin>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\admin/.ssh/id_rsa): ssh-wrt
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ssh-wrt.
Your public key has been saved in ssh-wrt.pub.
I did try with puttygen.exe too, but face this error when using that key
the hidden folder is this folder, I just changed the name which I have hidden to admin.
I can't find the sub folder /id_rsa in .ssh folder only those two files. I do have hidden files disabled i.e all files are visible both hidden and normal.
Generating public/private rsa key pair.
Enter file in which to save the key (/home/admin/.ssh/id_rsa): uopenwrt
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in uopenwrt
Your public key has been saved in uopenwrt.pub
The key fingerprint is:
login as: root
Authenticating with public key "rsa-key-20220711"
BusyBox v1.33.2 (2022-04-16 12:59:34 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 21.02.3, r16554-1d4dea6d4f
-----------------------------------------------------
root@OpenWrt:~#
Login without password
I want similar access from win 11's ssh and also from ubuntu's SSH.
Problems creating the keys under Windows 11 is off topic.
Since you managed to create them with Putty, you can use them in Windows.
If you still insist on creating the keys in Windows, it would be better to ask in Windows related forums.
The thing is that you don’t need to do a SSL key with every system you want to use. You have one high quality crypto system running for example OpenSSL to make all the keys and then distribute them to the systems that are supposed to use them.
From a security perspective, the private ssh keys should never leave the system they've been generated on (aside from rather specific use case, like offline backup or using a high-entropy system to generate keys for low-entropy ones). Sharing ssh keys between different devices (or even parallel installations on the same system) is a recipe for big security breaches (just like sharing passwords between different web services).
How much bigger security breach than using Windows to do the keys in the first place?
There is no real problem distributing keys offline.
And routers and low end crypto devices are really bad choices for use of generating crypto keys anyway, simply because they don’t have any good RNG to get meaningful entropy data.
Makes sense to me. You were in the “admin” directory when you ran the command and you overrode the default path and filename with just the ssh-wrt filename and no path, so it saved it in the current directory with the name given.
Move the 2 files to c:\users\admin\.ssh\ and either: rename them as id_rsa, or pass them to the ssh command via the -i parameter with the existing name, or create a config file in .ssh using the IdentityFile option to point to your custom key file filename.
Windows ssh client will behave much like a regular OpenSSH client so you can refer to a lot of the online docs for syntax help.