Results 1 to 10 of 14

Thread: Can read but not write to Samba Share with Win7

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Location
    Minneapolis USA
    Beans
    42
    Distro
    Kubuntu 11.10 Oneiric Ocelot

    Can read but not write to Samba Share with Win7

    I set up a samba share on my desktop running kubuntu Lucid. I used the samba config tool set up my share folder. I have a home network with a router and three computers.

    I can access the share from laptop running Win7 and I can read files, but I cannot write to the share. The last lines of my smb.conf are:

    [ShareName]
    path = /home/username/
    #read only = no
    writeable = yes
    browseable = yes

    I set the security level of the share to "Share" from a list of
    (Share, User, Server, Domain, ADS).

    I accomplished the above from the samba instructions at kubuntuguide. What should I do next?

  2. #2
    Join Date
    Dec 2009
    Beans
    6,777

    Re: Can read but not write to Samba Share with Win7

    [ShareName]
    path = /home/username/
    #read only = no
    writeable = yes
    browseable = yes
    Your share has two problems unless you did some other things that you didn't post.

    It's not allowing guest access so you needed to create a samba user for access.

    Even if you did create a samba user the only one that would allow write access is "username" because of the underlying Linux file permissions of the path.

    By default, your home directory has permissions of 755. The owner can read and write ( the "7" ) and everyone else can only read ( the "5"'s ).

    So you can set up a samba user for "username",

    Or change the permissions on the target to 777:
    Code:
    sudo chmod 0777 /home/username
    Or add a line to the share definition to convert the remote user to username:
    Code:
    force user = username
    Then restart samba.

  3. #3
    Join Date
    Jul 2007
    Location
    Minneapolis USA
    Beans
    42
    Distro
    Kubuntu 11.10 Oneiric Ocelot

    Re: Can read but not write to Samba Share with Win7

    I created a samba user for username
    Code:
    sudo smbpasswd username
    Old SMB password:
    New SMB password:
    Also, I chmod /home/username
    Code:
    sudo chmod 0777 /home/username
    I didn't try your last suggestion to force user = username.

    Then I restarted samba server
    Code:
    sudo service smbd restart
    sudo service nmbd restart
    I got the same result from windows7. Shouldn't I get a prompt for the samba username and password from windows explorer? I'm using Win7 home. I also tried from another desktop running winXP professional and I got an error saying that write protected or disk is full.

  4. #4
    Join Date
    Dec 2009
    Beans
    6,777

    Re: Can read but not write to Samba Share with Win7

    This isn't some encrypted home directory, is it?

    If not then post the output of the following commands so we can see what's up:
    Code:
    testparm -s
    Code:
    ls -dl /home/username

  5. #5
    Join Date
    Jul 2007
    Location
    Minneapolis USA
    Beans
    42
    Distro
    Kubuntu 11.10 Oneiric Ocelot

    Re: Can read but not write to Samba Share with Win7

    Here is testparm

    HTML Code:
    adam@dell16:/home$ testparm -s
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[ADAM]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
            workgroup = WAGON
            server string = %h server (Samba, Ubuntu)
            security = SHARE
            map to guest = Bad User
            obey pam restrictions = Yes
            pam password change = Yes
            passwd program = /usr/bin/passwd %u
            passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
            unix password sync = Yes
            syslog = 0
            log file = /var/log/samba/log.%m
            max log size = 1000
            logon path = \\%25N\%25U\profile
            logon home = \\%25N\%25U
            domain master = No
            dns proxy = No
            usershare allow guests = Yes
            panic action = /usr/share/samba/panic-action %d
            guest ok = Yes
    
    [printers]
            comment = All Printers
            path = /var/spool/samba
            create mask = 0700
            printable = Yes
            browseable = No
            browsable = No
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/printers
    
    [ADAM]
            path = /home/adam/
            read only = No
    adam@dell16:/home$ 
    and here is ls -dl

    Code:
    adam@dell16:/home$ ls -dl /home/adam
    drwxrwxrwx 58 adam adam 4096 2011-04-07 15:20 /home/adam
    I think the problem is that I can't create a samba user.

  6. #6
    Join Date
    Dec 2009
    Beans
    6,777

    Re: Can read but not write to Samba Share with Win7

    Now that I see your entire smb.conf I notice that you have in your [global] section the following parameter:
    guest ok = yes
    Since it's in the global section it will apply to all shares unless you override that in the share definition itself - which you have not. So your share is allowing guest write access and needs no samba user.

    The remote guest should have the ability to write to that share - meaning the ability to add to or delete from that share. It's unlikely that he will be able to write to the contents of that share - i.e., edit a file - since the linux permissions on a particular file would not allow it.

    So just to be clear, are you talking about adding a file to the share or are you talking about editing a given file within that share. If it's the latter then "force user = adam" in the [ADAM] share is the easiest way out of this.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •