WSL Access .ssh in Windows

WSL Access .ssh in Windows

SSH

Using the same .ssh folder in Windows

Issue: File Permission requirement in SSH for Config file and private key

ln -s /mnt/c/Users/UserName/.ssh ~/.ssh

Change Default Permission

sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=77,fmask=111

Auto-mount

sudo vim /etc/wsl.conf
#Let’s enable extra metadata options by default
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=77,fmask=111"
mountFsTab = false

#Let’s enable DNS – even though these are turned on by default, we’ll specify here just to be explicit.
[network]
generateHosts = true
generateResolvConf = true

Logout all the session then log back in

Git

Issue: git status not recognising commit between Windows and Ubuntu

set autocrlf to true.

git config core.autocrlf true