ssh-keygen -t ed25519 -C "[email protected]"
See gitub.com: Generating a new SSH key and adding it to the ssh-agent:
Key/pub will be here ~\.ssh
and will look like id_ed25519
and id_ed25519.pub
$task = New-ScheduledTaskAction -Execute "C:\Windows\System32\wsl.exe" -Argument '-u root bash -c "ssh-agent -s && sleep 3"'
$trigger = New-ScheduledTaskTrigger -AtLogon
$settings = New-ScheduledTaskSettingsSet -DontStopIfGoingOnBatteries -AllowStartIfOnBatteries
Register-ScheduledTask RunSshAgent -Action $task -Trigger $trigger -Settings $settings
- Open Windows Settings
Apps -> Apps & features -> Optional Features -> [+] Add Feature
.- Choose
OpenSSH Client
and install it.
# Set the sshd service to be started automatically
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic
ssh-keygen -t ed25519 -C "[email protected]"
See microsoft.com: Управление ключами OpenSSH
Key/pub will be here C:\Users\<user-id>\.ssh
and will look like id_ed25519
and id_ed25519.pub
see gitlab: Configure SSH to point to a different directory
Edit ~/.ssh/config
(or %USERPROFILE%/.ssh/config
in Windows)
Host <company-git-host>
PreferredAuthentications publickey
IdentityFile ~/.ssh/<corp-private-key-filename>
Host github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<github-private-key-filename>
git remote set-url origin git@<host>:<user>/<path>.git
or
git remote set-url origin git@<host>:<path>.git