-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission denied on specific operations when using symlink to network share #1561
Comments
Check #1258 |
Thanks, I've seen this and this is where I started, but the issue for me is that even though this workaround works and I can create/delete/rename files and folders, I cannot append data to the files I've created. I've enabled a security audit on the NTFS folder where the network share lands via the symlink and I can see that the first event is access request:
This is all fine and well I believe, but the next audit events show where it fails:
The next two events are "The handle to an object was closed." - one from SYSTEM and another from the domain user who connected to the SFTP session initially. Edit: |
Hello, |
This appears to be a bug in the server, I still haven't found a solution as well. |
Also having the same bug. Windows Server 2016 Standard Core 10.0.14393 NTFS rights are correct, the user has correct permissions and can create / upload / delete stuff in a PS session or the Windows explorer. |
I'm having the same problem. From a Windows perspective, openssh should run under an AD service account to access a network share. It appears that this is not intended with OpenSSH. I would be very happy to find a solution for this problem. |
We are having the same issue. We had to develop a file sync job to circumvent this bug. Please do tell if we can do anything to help getting it fixed. |
Looks like there is still no solution to this, which sadly makes the application useless to a lot of people. |
Are anyone from the project receiving e-mails or notifications about this issue? I'm sorry i'm a bit new to Github issues. @maertendMSFT @manojampalam This problem makes it impossible to have a non-hacked setup of an SFTP-server, where the files are located on another server/file cluster via smb/file shares. |
Yes, we get notifications :) There can be some delay in responses/solutions based on current prioritization of Win32-OpenSSH. @bagajjal , can you look at this issues again? |
New to github and unfortunately a negative first post - my project has decided not to proceed with openssh due to the same limitation... we have a requirement where -
But I will keep a track of this story.. hopefully will proceed with openssh once the fix is available... thank you... |
Just compiled the latest version from the repo and this issue still occurs in August of 2022. I tried earlier in the year and came across similar posts with this bug dating back to 2019. This issue unfortunately doesn't appear to be a priority and as another mentioned, makes this deployment useless on Windows for a lot of people. We have unfortunately moved over to the SolarWinds SFTP server but it too has its own set of limitations- but not of the symlink variety. |
We actually retested this just two weeks ago and nothing has changed in this regard. |
@sawo1337 Can you test your scenario with the latest release of OpenSSH? I am able to repro the behavior you described on version 8.9, but the write operation works on version 9.2. |
This issue was fixed in this PR: PowerShell/openssh-portable#596 Let us know if you are able to repro this on the latest release. |
sure, I'll get this running on my test environment in the next couple of days, great to hear finally having a solution for it! |
I can confirm this is now working as expected, creating a junction to UNC works fine! |
Just confirm. Its work 🥇 |
Hi @vthiebaut10 Not to be rude or anything but I am still having the above mentioned problem using Microsoft OpenSSH 9.2.2.0 As for now I have, say 10 users getting their own ChrootDirectory E:\root\root%u The point is that 1) all users have their own folder, and 2) they all share a folder from where they can all read, write etc. When I log in and follow the symbolic link to the shared folder I can view files, I can rename but whenever I want to upload a file the file is created but it is a zero byte file. I get a permission denied from SFTP-client (FileZilla for testing) and eventually reports success. Permissions are granted correctly - I've even, as for test, granted the Everyone account and also added the specific user and the group that I expect the users to be member of. If I set the ChrootDirectory to the shared folder I have no problem uploading. So I take that it is still a problem related to the symbolic link. |
That behavior is expected if the symlink points to a folder outside of the new root. It should work with a network share though. |
Because of security so that I don't upload a symbolic link pointing to a local folder like C:\Windows\System32 or whatever? |
This was what I experienced as well. I was able work around this by making a share to the same computer |
"OpenSSH for Windows 8.1.0.0"
Windows Server 2016 Datacenter
Client OperatingSystem
Any
What is failing
When using a symlink to a network share as ChrootDirectory, I can rename files, delete files, create empty files, but as soon as I attempt to append any data to the file I just created, I get permission denied. An empty file is created on the server, but no data is in it.
I'm using domain users, they have full permissions over the network share, NTFS permissions on the network server, I can log in using the same user and create files just fine, but as soon I attempt the same using SFTP client, it fails with permission denied error.
On the target server, I can see the correct user is attempting the operation, but for some reason, it fails. No failure is logged on the network share server, tried different network share server where everyone has full control, but still no go.
It is interesting that during testing this worked for a brief moment, but then it never worked afterward.
This is all with password authentication.
Config:
AllowGroups domain\sftpgroup
AuthenticationMethods password
ForceCommand internal-sftp
ChrootDirectory C:\root\sftpnetworksharesymlink
AllowTcpForwarding no
PermitTunnel no
GatewayPorts no
Expected output
Files are uploaded by the logged-in user.
Actual output
An empty file is created and then permission denied message is shown on the client.
The text was updated successfully, but these errors were encountered: