Accessing a symlink via OpenSSH on Windows

1.1k views Asked by At

I've installed OpenSSH server on Windows 10. I've set up authentication using the .ssh\authorized_keys file, which works well. I can now login from Linux/Windows/etc via ssh to Windows 10.

The user I am logging in as has a symbolic link in their home directory to a directory on a server, created via mklink /d C:\Users\username\folder \\servername\path. I can access the symlink directory just fine as username over remote desktop, or locally. However, when I try to access the symlink via ssh I get a permission denied error.

I can fix this by running net use \\servername\path after logging in via ssh. So it looks like the issue has to do with credentials of some sort? I would like to automate this process (or just fix the underlying issue) so that users can access C:\Users\username\folder without having to run a command on login.

My first attempt was to add the net use command to .ssh/rc, but that didn't work. Does anyone else has some ideas on how to address this?

Some extra information: If I log in with a password instead of an ssh keypair then it works fine. However, I'd like to stick with the keypair approach, and I'm stumped on that route.

0

There are 0 answers