UNIX Samba: Make A Share Writable

How do I make a Samba share writable under UNIX / Linux operating systems, especially all home directories for respective users?

By default, the home directories and other share are exported read-only or configured as read only. Change the “read only” parameter to ‘no’ if you want to be able to write to them via other CIFS clients.

Configuration

Edit /etc/samba/smb.conf, enter:
# vi /etc/samba/smb.conf
Fine [Home] share configuration and update it as follows (note wriable is set to yes):

[homes]
        comment = Home Directories
        browseable = yes
        read only = no
        writable = yes
       valid users = %S
       valid users = MYDOMAIN\%S

Save and close the file. Restart samba server:
# /etc/init.d/samba restart
OR if you are using RHEL specific distro, enter:
# service smb restart


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • a user Nov 6, 2013 @ 8:01

    hello nixcraft,

    you need to add the user to the sambas password database or nothing will work.
    smbpasswd username

    username is a valid linux account name, the password you set here does not need to be the same as the linux login one.

  • a user Nov 6, 2013 @ 8:02

    and writable is a synonym for readonly = no, so you need only one.

  • a user Nov 6, 2013 @ 8:05

    and please if you use writeable = yes, write it correctly…..
    samba will accept both. but one is english, the other is i dont know….

  • venkata krishna Oct 12, 2015 @ 16:27

    hello,
    can you please give me the code in c to pass CLEAR directory in terminal?

  • Ngoato Sep 7, 2016 @ 3:32

    These instructions do not work. Even when writeable is set to yes and the samba password is set, the machine does not allow you to write in this folder.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum