SSH keys (passwordless connection)
Generate and deploy SSH keys to secure and simplify your connections.
What this tutorial does
The tutorial "SSH keys (passwordless connection)" helps you achieve this goal:
Generate and deploy SSH keys to secure and simplify your connections.
Windows (PowerShell) + Linux
-
--- Generate an SSH key pair on Windows (PowerShell) --- -
ssh-keygen -t ed25519 -C "[email protected]" -
Accept the default path: C:\Users\YourName\.ssh\id_ed25519 - Set or leave the passphrase blank.
- --- Copy public key to container ---
-
Method 1 (PowerShell): type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" -
Method 2 (from Linux): ssh-copy-id -i ~/.ssh/id_ed25519.pub root@IP - --- Check rights on the server ---
-
chmod 700 ~/.ssh -
chmod 600 ~/.ssh/authorized_keys - --- Test connection without password ---
-
ssh root@IP (should not ask for a password) - --- Disable password authentication ---
-
In /etc/ssh/sshd_config: PasswordAuthentication no -
systemctl restart sshd