Howto: Adding share in samba server under Linux or UNIX

Q. How do I add share called incoming? This share definitions should be linked up to directory called /home/incoming.

ADVERTISEMENTS

A. You can define a share using samba configuration file itself. Open /etc/samba/smb.conf file and add code snippet as follows:

# vi /etc/samba/smb.conf

Add following code:

[incoming]
   comment = Icomming data
   writable = yes
   path = /home/incoming

Save close the file. Restart Samba :
# /etc/init.d/samba restart
If you are using Redhat/CentOS/Fedora core type:
# service smb restart

See also:

=> A Samba permission howto

=> For more information and samba configuration option read smb.conf man page by typing following command:
man smb.conf

=> Visit official samba web site for more examples and information.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig 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 jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
5 comments… add one
  • Nitin Kumar Oct 5, 2009 @ 10:36

    Hi,
    I did the same…but it dint worked…whenever i try to connect samba share it prompts “Network path could not found”

  • Collin B Apr 11, 2012 @ 23:42

    It is advisable to do an include to an extras file and put your samba share configs in there. Isolate your custom changes away from an applications main configuration file if it all possible.

    Another great post that I used for quick reference. Thank you for your site!

  • hassan h Aug 22, 2012 @ 12:43

    Well, I think it is “Incoming” in the code : “comment = Icomming data”
    if not plz tell me :)

  • mahesh Jan 29, 2013 @ 6:58

    What are the steps required if i have to share the same share files and printers (In samba)with Active Directory users as well as local users..

  • Rod Apr 9, 2013 @ 19:53

    Um… don’t you have to create the directory /home/incoming ?
    and does it need chmod and chgroup and do I need to add user passwords to samba or will it just work from the windows clients?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.