System Administration & Network Administration
linux active-directory java mount user-management
Updated Thu, 23 Jun 2022 03:48:23 GMT

Access secured windows folder with java on a linux server

We're trying to mount a secured windows share on a linux server, but until now we're unable to do so. This is the setup we're having:

  • A linux server that runs a java application
  • A windows share that only allows members of a certain security group for read/write access
  • The java application should be able to write files to the windows share
  • I am told, as I'm a total Linux newbie, that we should mount that folder
  • When we execute the mount command, we're getting "29353: session setup failed: ERRDOS - ERRnoaccess (Access denied.)"
  • This probably means that the linux user is not authorized to access the shared folder. This makes sense as a linux user isn't an AD user.

So the real question here is, what should we do so that we can access a secured shared windows folder in a java application run by a linux user? Is the mount a correct solution or do we need another approach. Thanks a lot!


You're trying to mount a CIFS share and you need to do so with a Windows username and password that has access:

mkdir /mnt/cifs
mount -t cifs //server-name/share-name /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft

Example Source:

Comments (2)

  • +0 – You can also do the domain inside the username field -o username=nixcraft\\shareuser,password=sharepassword — Nov 14, 2013 at 17:10  
  • +1 – As we're using a (legacy, old) linux server, we're only able to mount with - t smbfs. Works like charm! Thanks — Nov 15, 2013 at 13:43  

External Links

External links referenced by this document: