mount windows share - ISPconfig 3, Debian

Discussion in 'ISPConfig 3 Priority Support' started by inside83, Feb 17, 2015.

  1. inside83

    inside83 Member HowtoForge Supporter

    Hello,

    I need to mount 4 folders from 4 different Windows PC's.
    Folders are shared in a Windows domain network.
    The idea is that web application located on /var/www/clients/client1/web1/web reads the files located on those 4 folders.
    I followed this: https://wiki.ubuntu.com/MountWindowsSharesPermanently guide and took some from this: http://askubuntu.com/questions/354235/fstab-wont-mount-share-cant-see-what-im-doing-wrong but I constantly get:
    Code:
    mount error(95): Operation not supported
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    I added this to /etc/fstab:
    Code:
    //192.168.1.200/log    /var/www/clients/client1/web1/web/csv/server_log  cifs    credentials=/var/www/clients/client1/web1/web/csv/.smbcredentials,iocharset=utf8,dir_mode=0777,gid=1000,uid=1000,sec=ntlm  0   0
    and my .smbcredentials file looks like this:
    Code:
    username=administrator
    password=password
    domain=mydomain.local
    Please help.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Are you sure that gid=1000,uid=1000 are the right uid and gid of the user and group of this website?
     
  3. inside83

    inside83 Member HowtoForge Supporter

    No, I'm not. I just got it from those tutorials.
    How to know the real uid and gid?
    The idea is that web1 can read/write the contents of those folders.
     
    Last edited: Feb 18, 2015
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    run:

    ls -la

    inside the web folder, you will then see which user and group owns the web folder. This user and group are the web user and client group of this website. Then tale a look inti the /etc/passwd and /etc/group file to lookup the numeric ID of the user and group.
     
  5. inside83

    inside83 Member HowtoForge Supporter

    Till,
    This is what I get when I run ls -la (please see the attachment).
    And uid and gid of the web1 client1 are 5005, I'm guessing?
     

    Attached Files:

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    uid=5004
    gid=5005
     
  7. inside83

    inside83 Member HowtoForge Supporter

    So the complete line that I should add to etc/fstab should be:
    Code:
    //192.168.1.200/log    /var/www/clients/client1/web1/web/csv/server_log  cifs    credentials=/var/www/clients/client1/web1/web/csv/.smbcredentials,iocharset=utf8,dir_mode=0777,gid=5005,uid=5004,sec=ntlm  0   0
    ?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Looks better. But I dont use any civfs mounts, so I cant give you the exact syntax for your case.
     
  9. inside83

    inside83 Member HowtoForge Supporter

    What do you use?
    Is there another way?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I run servers in datacenters only, there are no windows pc's in such a setup as this would be way to insecure to expose their network shares to the internet
     
  11. inside83

    inside83 Member HowtoForge Supporter

    Thank you for your support but again I get the same error:
    Code:
    mount error(95): Operation not supported
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    are you able to mount in another diretory like /mnt on your server?
     
  13. inside83

    inside83 Member HowtoForge Supporter

    Ok, so Ive managed to get it to work with this line in /etc/fstab:
    Code:
    //192.168.1.51/EXPORT    /var/www/clients/client1/web1/web/csv/1  cifs    credentials=/mnt/.smbcredentials_domain,iocharset=utf8,gid=5004,uid=5005  0   0
    But when I access web/csv/1 folder with FilleZilla and try to edit/create new file it says:
    Code:
    Command:    MKD /web/csv/1/New directory
    Response:    550 Can't create directory: Permission denied
    I have tried with gid=0, uid=0 (root) but it is the same.
    My /mnt/.smbcredentials_domain file looks like this:
    Code:
    username=administrator
    password=[password]
    domain=[my_domain] (without ".local")
    I point out that user my_domain\administrator has read/write access to 192.168.1.51/EXPORT folder in Windows.

    I just tried adding:
    Code:
    dir_mode=0777
    to /etc/fstab line but still no read/write access.

    UPDATE 1:
    I am able to read/write files if connect to server with WinSCP using root account.

    UPDATE 2:
    Success!
    When I looked at the owner of the folder "/var/www/clients/client1/web1/web/csv/1" with WinSCP it was web2.
    Then I created new folder with FilleZilla, looked at it with WinSCP and the owner of the new folder was web1.
    Then I just changed the line in /etc/fstab and now I have read/write acces.
    Finally!
     
    Last edited: Feb 19, 2015
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    If you connect the share with gid=0, uid=0 , then only root can write to it.
     
  15. inside83

    inside83 Member HowtoForge Supporter

    Acctually, this:
    Code:
    //192.168.1.51/EXPORT    /var/www/clients/client1/web1/web/csv/1  cifs    credentials=/mnt/.smbcredentials_domain,iocharset=utf8,dir_mode=0777,gid=0,uid=0  0   0
    is the complete line in /etc/fstab and I have read/write access on 4 different Windows PC's, so I added 4 lines in /etc/fstab - different IP's and folders (1, 2, 3 and 4).
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    The part:

    gid=0,uid=0

    instructs the system to allow access only to the root user. Thats why you can access it as root only. you have to set this to the user and grup that shall access the files. Then you should try to add the option "rw" to allow rite access.

    See also smbmount manpage

    http://linux.die.net/man/8/smbmount
     

Share This Page