![]() ![]() Then restart your WSL distro and voilà, all your SSH keys and config will be automagically available in Linux. The other mount flags will ensure the permissions on the. Add the following line at the end: C:\Users\\.ssh\ /home//.ssh drvfs rw,noatime,uid=1000,gid=1000,case=off,umask=0077,fmask=0177 0 0 Open your Linux distro and edit the /etc/fstab file as root (e.g. And since Windows drives and folders can be mounted directly in WSL using DrvFs, we can combine them to automatically sync the. Your public key has been saved in /root/.ssh/idrsa.pub. Enter file in which to save the key (/root/.ssh/idrsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/idrsa. ![]() ssh directory directly and doesn't require changing /etc/wsl.conf to enable the metadata option (which can be a bit heavyweight, in my opinion).īy default, most/all Linux distros read and process the fstab file on startup, to automatically mount filesystems. Hi first use below command on source server ssh-keygen Generating public/private rsa key pair. You should now be able to fully share your Windows SSH config, hosts, and keys with your WSL distro, while maintaining them in a single place. ssh directory, and create a symlink back to your C: drive's. You can either make a new key by running ssh-keygen and give your friend the key pair and delete the private one from your machine, or either add the private. Note that ssh-copy-id command uses the public key of the current user running the command which has the private key beside it. ssh directory and key files, as required by SSH: $ cd /mnt/c/Users/įinally, navigate to your distro's home drive, backup or remove any existing. No, You only need his public key stored in /.ssh/idrsa.pub. Navigate to your mounted C: drive at /mnt/c/Users/, and set the proper permissions on the. These options ensure that files in the mounted system are given proper user and group ownership, and that they have sensible default permissions (as opposed to everything getting 777).Ĭlose the distro, wait about 10 seconds for the background subsystem to stop running, and reopen the distro. Open your distro, and create or modify the /etc/wsl.conf file to include the automount options below: $ cat /etc/wsl.conf To build on helpful answer, here's what worked for me.
0 Comments
Leave a Reply. |