Created
May 9, 2025 18:25
-
-
Save matheuseduardo/4b384c927b9395ee921bcc6688802dbf to your computer and use it in GitHub Desktop.
use same ssh keys between windows user and wsl user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://superuser.com/a/1676775/91564 | |
# - só devem ser executados após alterar o mount no /etc/wsl.conf | |
# - e reiniciar o Ubuntu | |
# (wsl --terminate Ubuntu; wsl --list --verbose) | |
# checar se terminou e iniciar | |
cd ~ # ir até pasta do usuário | |
mv .ssh .ssh_orig # fazer backup do conteúdo atual | |
ln -s /mnt/c/Users/<user>/.ssh/ .ssh # criar um link da pasta do usuário atual do windows dentro do WSL | |
chmod 700 .ssh | |
chmod 600 .ssh/id_rsassh list | |
chmod 644 .ssh/id_rsa.pub | |
sudo services ssh reload | |
sudo services ssh restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/wsl.conf | |
# adicionar: | |
[automount] | |
options = "metadata,umask=022,fmask=111" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment