Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Can not access a mapped network drive through ssh

Open Lally11 opened this issue 4 years ago • 5 comments
trafficstars

I have one server (Microsoft Windows Server 2016) with OpenSSH installed; On this server I have one mapped network drive (K). On this network drive I have one git Project. From another computer I want to clone that git project, but it is saying that is not a git repository. From the server I have direct access to the K. Capture

I have access with ssh to the server, I can clone project that are stored on local drives of the server.

I am using the public key authentication. How can I clone a project from a mapped network drive from another computer.

Lally11 avatar Feb 03 '21 10:02 Lally11

On this server I have one mapped network drive (K)

Drives are mapped in the context of user sessions. The "server" does not have a mapped drive. So, has the drive been mapped in the context of the ssh session?

I am using the public key authentication. How can I clone a project from a mapped network drive from another computer.

Authenticating with a public key will not give you access to network resources from the target machine that require authentication (i.e. the double-hop problem). So, its likely that even if you tried to map a drive, it would fail if it required authentication. You'll need to authenticate to ssh via password, or kerberos (with delegation)

mwtrigg avatar Feb 03 '21 15:02 mwtrigg

Just to add some more info, while you can have a drive mapping for a particular user in the registry they are not actually created by Windows when you logon through the network. They are only done when you have an interactive or RDP logon so if you want to use a mapped drive you need to map it in your session manually. At that point you may as well just use the UNC path.

In saying that what mwtrigg is saying about the double hop problem is going to be an issue when you use public key authentication.

jborean93 avatar Feb 04 '21 04:02 jborean93

Hi,

The drive hasn't been mapped in the context of the ssh session. I am looking for a solution that use the public key authentication.. I don't have knowledge about kerbenos, but for what I read kerbenos seems to be more appropriate from the solution I am searching for.

Lally11 avatar Feb 04 '21 12:02 Lally11

If you need to access file on a remote file server you essentially have to provide a way so that the remote session can use that password to access the file server. This can be done automatically if you use password authentication or with Kerberos + delegation. This could also be done explicitly by calling net use with explicit credentials in your SSH session or some other process.

As for mapped drives I would personally give up on using them in SSH. You can always map it manually again in the SSH session but at that point you are better off using the UNC path anyway. Leave mapped drives for interactive usages when you log on normally or with RDP, use UNC for the rest.

jborean93 avatar Feb 04 '21 22:02 jborean93