Creation of SSH key under Windows
If you want to use a SSH key in Windows, for example for the access to Linux servers or for the use of SSH keys in combination with Proxmox VE and CloudInit, the best way to do this is with the Windows Power Shell. First, you have to create a key pair before SSH connections via SSH public key can be set up. For this, a PowerShell must be opened and the following must be entered:
PS C:\Users\jsterr> ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (C:\Users\jsterr/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in C:/Users/jsterr/.ssh/id_rsa. Your public key has been saved in C:/Users/jsterr/.ssh/id_rsa.pub. The key fingerprint is: SHA256:da33hUyOnLrFN/7mqvB1rGRrZreBRa8TzYV5EjoJE88 tkag\jsterr@Standard-020 The key's randomart image is: +---[RSA 3072]----+ | +. . | | = + + | | . E *.o| | . o O.*o| | S = *.=| | o .o=.| | o o.O.+| | = *+*+| | . o==B+| +----[SHA256]-----+
The SSH public key under the path C:\Users\jsterr/.ssh/id_rsa.pub can be stored in the file on any Linux server /root/.ssh/authorized_keys. Unfortunately, there is no SSH copy ID in the PowerShell. However, you can work around this as follows:
PS C:\Users\jsterr> type $env:USERPROFILE\.ssh\id_rsa.pub | ssh root@10.2.1.130 "cat >> .ssh/authorized_keys" root@10.2.1.130's password: PS C:\Users\jsterr>
After this, a login to the Linux server is possible without entering a password.
PS C:\Users\jsterr> ssh root@10.2.1.130 Linux PMX4 6.5.13-1-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.13-1 (2024-02-05T13:50Z) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Feb 21 20:15:35 2024 from 192.168.125.36 root@PMX4:~#
|
Author: Jonas Sterr Jonas Sterr has been working for Thomas-Krenn for several years. Originally employed as a trainee in technical support and then in hosting (formerly Filoo), Mr. Sterr now mainly deals with the topics of storage (SDS / Huawei / Netapp), virtualization (VMware, Proxmox, HyperV) and network (switches, firewalls) in product management at Thomas-Krenn.AG in Freyung.
|
|
Translator: Alina Ranzinger Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.
|


