Samba: installation, configuration, optimization of work. Samba File Server

Samba is a program that allows UNIX/Linux computers to simulate windows machines. With Samba, computers can exchange files or manage print jobs as file servers or Windows print servers. Like the UNIX/Linux operating system on which it runs, Samba is open source software developed by many programmers.

SMB protocol is used Microsoft Windows 2000, NT and 95/98 for disk and printer access. Using the Samba toolkit by Andrew Tridgell ( [email protected]), UNIX machines (including Linux) can share disks and printers with Windows machines. smbfs utilities written by Paal-Kr. engstad ( [email protected]) and Volker Lendecke ( [email protected]) allow UNIX machines to mount SMB shares available on Windows or Samba machines.

Using Samba, you can implement the following most common ones:

  1. Give access to Linux disks Windows machines.
  2. Get access to Windows disks for Linux machines.
  3. Give access to Linux printers for Windows machines.
  4. Access Windows printers from Linux systems.

Installing and testing Samba

Installation, as you know, should begin with a detailed study of the documentation. True, the majority system administrators neglect this rule, guided by another: "If nothing helps, read the documentation." In general, we recommend that you start your Samba installation with a simple command: $ man samba (Figure 1).

And also from reading the documentation available at http://www.samba.org/. It should be noted that in order to use Samba, your machine must be on a single Ethernet segment of the local network, while using the TCP/IP protocol. Samba won't work when using others network protocols. This is basically easy, since Linux and Windows 95/98/NT come with TCP/IP support. However, if you are using Windows 3.x machines, then you need to add TCP/IP support.

Where to get

To get the source texts latest version Samba, go to http://www.samba.org/ and select the mirror server closest to you: ftp://ftp.samba.org/. The Samba package is included in distributions of a number of UNIX/Linux systems, such as Rad Hat or Suse Linux. Carefully read your Linux documentation, and it's possible that all you need to do is insert the CD and install the Samba packages. In this case, you can continue reading the article from the next chapter.

After receiving this package, we extract everything that is under the “bar” * .tar.gz, for example, to the /tmp directory (and you don’t have to be root :) for this, that is:

$ tar -zxvf samba-latest.tar.gz

If you didn't have any problems extracting this package, you will find a new directory, such as samba-latest, with the extracted files in it. Go to it, take a look at the "README" and "Manifest" files - the installation instructions are in the last file and look something like this:

$ ./configure $ make $ su # make install

Now you need to pay attention to where your configuration files are located. Most Samba distributions put them in /etc by default and put themselves in /usr/local/samba.

Configuring Samba

The basic Samba configuration information is found in the smb.conf file. This file should be handled with care. If you plan to change the working version in any way, be sure to make a copy.

In order to start the server for the first time, you must have a working version of the smb.conf file. Change to the directory where your configuration file. Most likely it will be /etc or /usr/local/samba/lib. Make a copy given file, such as smb.old - this is possible if you have root privileges. Now that you have a "clean" file, you can enter the most simple configuration, that is, type the following lines:

#Basic Samba configuration file (smb.conf) workgroup = PTO netbios name = GALKA

Below we will understand what these lines in the configuration file mean, but first we will temporarily digress from it and move on to the SMB daemons.

Running daemons

There are two SMB daemons: /usr/sbin/smbd and /usr/sbin/nmbd. You can start Samba daemons from inetd or as a standalone process. Samba will respond slightly faster if it is running as a standalone process.

Sometimes it is necessary to check the /etc/services file for the following lines:

netbios-ns 137/tcp nbns netbios-ns 137/udp nbns netbios-dgm 138/tcp nbdgm netbios-dgm 138/udp nbdgm netbios-ssn 139/tcp nbssn

Make sure they are all uncommented. Depending on your distribution, you may even need to add them to this file. Samba will not be able to bind to the appropriate ports until these lines are in the /etc/services file.

To start daemons from inetd, place the following lines in the inetd configuration file, /etc/inetd.conf:

# SAMBA NetBIOS services (for PC file and print sharing) netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd

Then restart the inetd daemon by running the command:

Kill -HUP 1 `cat /var/run/inetd.pid`

To start daemons from system startup scripts, place the following script in /etc/rc.d/init.d/smb (for RedHat distribution) or /etc/rc.d (for Suse Linux distribution) and create symbolic links to it with the names /etc/rc.d/rcX.d/S91smb (starts SMB services in multi-user mode), /etc/rc.d/rcX.d/K91smb (kills SMB services on shutdown), /etc/rc.d/rc6 .d/K91smb (kills SMB services on reboot), where X is the system boot level number, usually 2 or 3.

#! /bin/sh . /etc/rc.config # Determine the base and follow a runlevel link name. base=$(0##*/) link=$(base#*) # Force execution if not called by a runlevel directory. test $link = $base && START_SMB=yes test "$START_SMB" = "yes" || exit 0 # The echo return value for success (defined in /etc/rc.config). return=$rc_done case "$1" in start) echo -n "Starting SMB services:" startproc /usr/sbin/nmbd -D || return=$rc_failed startproc /usr/sbin/smbd -D || return=$rc_failed echo -e "$return" ;; startd) echo -n "Starting SMB services:" startproc /usr/sbin/nmbd -D -d 10 || return=$rc_failed startproc /usr/sbin/smbd -D -d 10 || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down SMB services:" killproc -TERM /usr/sbin/nmbd || return=$rc_failed killproc -TERM /usr/sbin/smbd || return=$rc_failed echo -e "$return" ;; restart|reload) $0 stop && $0 start || return=$rc_failed ;; status) echo -n "Checking for service smb: " checkproc /usr/sbin/nmbd && echo -n "OK " || echo -n "No process " checkproc /usr/sbin/smbd && echo "OK " || echo "No process" ;; *) echo "Usage: $0 (start|stop|restart|reload|status)" exit 1 esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0

If you get a message when you start Samba that the daemon can't connect to port 139, then you probably already have Samba processes running that haven't been terminated. Look at the list of processes (using the "ps ax | grep mbd" command) to determine if there are any other Samba services running. If the daemons refuse to start for some other reason, then most likely this script does not fit your UNIX / Linux and you will have to delve into the documentation again, fix something in it, and maybe rewrite it.

Basic smb.conf setup

Obviously, in the configuration described above, Samba can function, but practically cannot do anything. More useful and complex examples will be discussed below. But first you need to understand the smb.conf directives.

Each section of the file begins with a section header such as , , and so on.

Now go to the very first tab "Configuration" (Configuration) and click on the button "Access to files and printers" (File and print sharing). In the window that appears, check the boxes “The files of this computer can be made public” (I want to be able to give others access to my files) and “Printers of this computer can be made public” (I want to be able to allow others to print to my printer(s)).

And finally, we indicate to Windows that Samba is the WINS server and that it will be the browse master. To do this, go to the properties of the TCP / IP protocol (Fig. 4). In the window that appears, select "WINS Configuration" (WINS Configuration). Check the box "Enable WINS resolution" (Enable WINS Resolution) In the appeared field "Primary WINS server" (WINS Server Search Order), enter the IP address of the server (Samba) - 192.168.0.1 and click "Add" (Add) or simply... Go to the "Advanced" tab and click on "Browse Master" in the left window, and set the value to "Disabled" in the right window. That's all. Now all that remains is to click the "OK" button several times and restart Windows.

In Windows NT, the network property screens are slightly different (shown in the figures), but the basic building concept is the same.

After restarting Windows, feel free to click on " network environment» (Network Neighborhood) and you will be able to see the Samba server as well as your home directory on the Linux server. Now you can simply connect these resources as network drives and assign them drive letters.

Let's complicate the configuration a bit: make the /home/public directory readable by everyone, but allow only people from the ADMINS group to put information in it. To do this, change the entry as follows:

Comment = Public Stuff path = /home/public public = yes writable = yes printable = no write list = @ADMINS

There are many more examples of Samba file server settings, but it's best if you take a look at the Samba documentation or man pages and figure it out yourself.

Access Windows disks from Linux

It is unlikely that novice users of Linux OS will be able to quickly figure out the system for accessing Linux files from under Windows, and vice versa. But not everything is so difficult. Access to Linux resources from under Windows was briefly described above, and we will now consider access to Windows resources from under Linux.

An SMB client program for UNIX/Linux machines is included in the Samba distribution. It provides an ftp-like interface command line. You can use this utility to transfer files between a Windows "server" and a Linux client.

To see what resources are available on a given machine, run the command:

/usr/sbin/smbclient -L host

where host is the name of the machine you want to see. This command will return a list of service names - that is, the names of drives or printers that can be accessed. Until the SMB server is configured without access control, it will prompt you for a password. When prompted, enter the password for the user "guest" or your personal password on this machine.

To use the client, run the following command:

/usr/sbin/smbclient service

where service is the name of the machine and service. For example, if you are trying to access a directory that is available as public on a machine named galka, then the name of the service should be \\galka\public.

You will receive an smbclient prompt:

Server time is Wen May 22 15:58:44 2001 Timezone is UTC+10.0 Domain= OS= Server= smb: \>

The commands for using Samba are similar to those for ftp, but if you don't know how to use either type h for help.

Of course, you can use smbclient for testing, but you will get tired of it very soon. You will most likely need the smbfs package to work. Smbfs comes with two simple utilities, smbmount and smbumount. They work like mount and umount for SMB shares. For example,

smbmount//computer_name/catalog/Mountpoint -U user_name

As a result, you will get a "mounted" resource with the ability to access it using the usual methods of the explorer.

Print server for Linux

To access a Linux printer from Windows machines, you need to make sure the printer is running Linux. If you can print under Linux, then arranging access to the printer will be very easy.

Add the printer setting to your smb.conf file:

Printing = bsd printcap name = /etc/printcap load printers = yes log file = /var/log/samba-log.%m lock directory = /var/lock/samba comment = All Printers security = server path = /var/spool /lpd/lp browseable=no printable=yes public=yes writable=no create mode=0700 security=server path=/var/spool/lpd/lp printer name=lp writable=yes public=yes printable=yes print command=lpr -r -h -P %p %s

Make sure that the path to the printer (in our case for ) matches the buffer directory specified in the /etc/printcap file, that is, check for the lines:

printcap name=/etc/printcap load printers=yes

These lines control whether all printers listed in /etc/printcap should be loaded by default. In this case, there is no need to configure each printer individually. The section specifies settings for printers that you want to specify explicitly. If the printing subsystem you are using does not work this way (BSD), then you need to set up a fake printcap file (or use "print command", see below). For getting additional information see the Printing-HOWTO for the printcap system.

Accessing a Windows Printer from Linux Machines

To access the printer on a Windows machine, the following conditions must be met:

  1. You need to have the correct entries in the /etc/printcap file, which must match the local directory structure (for the spool directory, etc.)
  2. You should have /usr/bin/smbprint. It comes with the Samba sources, but not with all Samba binary distributions.
  3. If you want to convert ASCII files to PostScript, you must have nenscript or equivalent. The nenscript program is a PostScript converter that is usually installed in the /usr/bin directory.

The entry in the /etc/printcap file below is for an HP 5MP printer on Windows server NT. The following fields in the /etc/printcap file are used:

cm - comment; lp - name of the device opened for output; sd - printer spool directory (on the local machine); af - printer usage accounting file; mx- maximum size file (zero - no restrictions); if - name of the input filter (script).

Fragment of /etc/printcap file:

# /etc/printcap # # //galka/oreilly via smbprint # lp:\ :cm=HP 5MP Postscript OReilly on galka:\ :lp=/dev/lp1:\ :sd=/var/spool/lpd/lp: \ :af=/var/spool/lpd/lp/acct:\ :mx#0:\ :if=/usr/bin/smbprint:

Make sure that the spool directories and the directory used for accounting exist and have write access. Make sure the "if" line contains the correct path to the smbprint script (given below) and that the entries point to the correct output device ( special file/dev).

#!/bin/sh –x # # Debugging log file, change to /dev/null if you like. # logfile=/tmp/smb-print.log # logfile=/dev/null # # The last parameter to the filter is the accounting file name. # spool_dir=/var/spool/lpd/lp config_file=$spool_dir/.config # Should read the following variables set in the config file: # server # service # password # user eval `cat $config_file` # # Some debugging help, change the >> to > if you want to same space. # echo "server $server, service $service" >> $logfile (# NOTE You may wish to add the line `echo translate" if you want automatic # CR/LF translation when printing. echo translate echo "print -" cat) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $user -N -P >> $logfile

Most Linux distributions come with nenscript to convert ASCII documents to PostScript.

Conclusion

More recently, Samba's capabilities were limited to those listed above. However, it's safe to say that the new version of Samba 2.2 catches up with Windows 2000 in terms of functionality and contains additional enhancements. Samba lead developer Jeremy Allison calls it a "major update" that will help Samba systems integrate more easily into Microsoft networks. The software provides savings not only because you don't have to pay for a server OS, but also because you don't have to pay for "client" licenses for all the computers that use the server.

About the new features of Samba 2.2. read our article "Samba 2.2 - what new » .

ComputerPress 10 "2001

Samba is software to organize the exchange of files and work with shared resources between computers running Linux / Unix and the Windows operating system. Samba consists of client and server parts. The client part allows you to access network folders and Windows resources, and the server part, in turn, shares the Ubuntu folder with other machines, including Windows.

This short guide will cover simplest setup Samba Ubuntu 18.04 and how to set up Ubuntu folder sharing with multiple privilege levels.

We will create three public folders with different permission levels. A folder with anonymous access, with access for users belonging to a specific group and access only for a specific user.

Both Linux and Widnows machines will be able to access shared folders in Ubuntu using any program that works via the SMB protocol.

For everything to work correctly, all machines must be in the same workgroup specified on the Samba server. By default on Windows, Linux, and MacOS, the workgroup is called Workgroup. To find out which workgroup is used in your Windows, open a command prompt (Win + R, then cmd) and run the following command:

net config workstation

We see the parameter we need in the line Domain workstation . This is the working group.

Now, if a computer with a Samba server on your network has a permanent IP address, it is advisable to enter it in hosts file. To do this, run the command prompt as an administrator:

And run the command:

notepad C:\Windows\System32\drivers\etc\hosts

In the file that opens, add a line with the IP address of the computer on which Samba will be installed:

192.168.0.1 srvr1.domain.com srvr1

Now we can move on to the question of how to share the Ubuntu folder.

Setting up Samba on Ubuntu 16.04

Let's start, as usual, with the installation. Installing Samba Ubuntu along with all the necessary components is done with the command:

sudo apt-get install -y samba samba-common python-glade2 system-config-samba

When everything is installed, you can proceed to the configuration. First, back up the original Samba configuration file:

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

After creation backup, create your configuration file with this command:

sudo vi /etc/samba/smb.conf

First, let's specify the global file server settings. To do this, insert the following lines into the file:


workgroup = WORKGROUP

netbios name = Ubuntu Share
dns proxy=no

max log size = 1000
passdb backend = tdbsam
unix password sync=yes

pam password change = yes
map to guest = bad user
usershare allow guests = yes

Let's take a closer look at what these lines mean.

  • work group- the working group, as already mentioned, should be the same on all machines
  • netbios-name- computer name that will be displayed in Windows;
  • log file- the address of the file where error messages and other information will be stored;
  • security- perform authentication at the user level by default;
  • name resolve order- order of resolution of IP addresses by NetBIOS name. bcast means send to local network broadcast request. If all computers between which interaction is planned are in the same network, this option is optimal;
  • passdb backend- method of storing user passwords;
  • unix password sync- synchronization of samba user passwords with local Unix passwords;
  • map to guest- Specifies when the user will be granted guest access. There are three values ​​available - never- never, bad user- when no such user exists, bad password- when the password is entered incorrectly,

When you have finished creating the configuration file, we move on to the question of how to share the Ubuntu folder for Windows.

Ubuntu Folder Sharing

First, let's create a public folder accessible to everyone. That is, with anonymous access, without samba authorization.

Create a folder to which we will open access, for example:

sudo mkdir -p /samba/allaccess

After the folder is created, you need to make the correct permissions for it. The following commands allow access to the folder for everyone and make the owner nobody:

cd /samba
sudo chmod -R 0755 allaccess
sudo chown -R nobody:nogroup allaccess/

The next step is to describe the allaccess folder in the samba configuration file:


path=/samba/allaccess
browsable = yes
writable=yes
guest ok = yes
read only = no

Your config file should now look like this:


workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
netbios name = Ubuntu Share
dns proxy=no
log file = /var/log/samba/log.%m
max log size = 1000
passdb backend = tdbsam
unix password sync=yes
passwd program = /usr/bin/passwd %u
pam password change = yes
map to guest = bad user
usershare allow guests = yes
#==============
path=/samba/allaccess
browsable = yes
writable=yes
guest ok = yes
read only = no

Let's take a closer look at the options that were used here:

  • path- path to the folder to be shared;
  • browsable- whether the folder will be displayed in the list of available shares;
  • writable- whether the folder will be writable;
  • read-only- the folder is read-only;
  • guest ok, public- whether guest access will be allowed;
  • only guest- if set to yes, then the folder will be available only to guests;
  • hosts allow- ip addresses from which you can access this server;
  • valid users- by default, all users can log in, if you pass a list of users in this parameter, then only they can log in;
  • create mask- rights mask for created files.

To apply the changes, restart the Samba server:

sudo systemctl restart samba

Configuring Samba Ubuntu 16.04 for anonymous access is now complete. Now you can check the accessibility of the allaccess shared folder from Windows, to do this, press Win + R and run:

\\srvr1\allaccess

You will see our folder. If you don't see it, check the configuration again. The folder can be accessed without samba authorization. The configuration of Samba shares with access without authorization is completed.

You can also connect to this server from Linux using Nautilus, just type the address smb://server ip, under other places:

Secure Ubuntu Folder Sharing

To share a folder for Windows Ubuntu that only users from a certain group will have access to, create a separate folder and describe it in the Samba configuration file in Ubuntu.

First we create a folder:

sudo mkdir -p /samba/allaccess/secured

Create a group:

sudo addgroup securedgroup

Setting up rights:

cd /samba/allaccess
$ sudo chown -R richard:securedgroup secured
$ sudo chmod -R 0770 secured/

The last step is to add settings to the samba configuration file:

sudo vi /etc/samba/smb.conf


path=/samba/allaccess/secured
valid users = @securedgroup
guest ok = no
writable=yes
browsable = yes

Restart the Samba server. Now access to shared folder in Ubuntu, only users of the securegroup can get it.

To test how it works, let's add the user richard to our group:

sudo usermod -a -G securedgroup richard

Implementation of network protocols Server Message Block (SMB) and Common Internet File System (CIFS). The main purpose is to share files and printers between Linux and Windows systems.

Samba consists of several daemons that run in the background and provide services and a number of command line tools for interacting with Windows services:

  • smbd- a daemon that is an SMB server for file and print services;
  • nmbd- a daemon that provides NetBIOS naming services;
  • smblient- the utility provides access from the command line to SMB resources. It also allows you to get lists common resources on the remote servers and view the network environment;
  • smb.conf- configuration file containing settings for all Samba tools;

List of ports used by Samba

  • share- this security mode emulates the authentication method used by operating Windows systems 9x/Windows Me. In this mode, usernames are ignored and passwords are assigned to shares. In this mode, Samba tries to use a client-supplied password that can be used by different users.
  • user* - this security mode is set by default and uses a username and password for authentication, as is usually done in Linux. In most cases, modern operating systems passwords are stored in an encrypted database that only Samba uses.
  • server- This security mode is used when it is necessary for Samba to authenticate to another server. For clients, this mode looks the same as user-level authentication (user mode), but in fact, Samba contacts the server specified in the password server parameter to perform authentication.
  • domain- using this security mode, you can fully join a Windows domain; to clients, this looks the same as user-level authentication. Unlike server-level authentication, domain-based authentication uses a more secure domain-level password exchange. To fully join a domain, you need to run additional commands on a Samba system and possibly on a domain controller.
  • ads- this security mode is similar to the domain authentication method, but requires a domain controller Active Directory domain services.

Full list of options Samba is in manpages .

Above was an example with access for a shared directory. Consider another example with a private directory, to which access is only by login and password.

Create a group and add a user to it

sudo groupadd smbgrp sudo usermod -a -G smbgrp proft

Create a directory for the user and set permissions

sudo mkdir -p /srv/samba/proft sudo chown -R proft:smbgrp /srv/samba/proft sudo chmod -R 0770 /srv/samba/proft

Create a samba user

sudo smbpasswd -a proft

Add a new resource to /etc/samba/smb.conf

path=/srv/samba/proft valid users=@smbgrp guest ok=no writable=yes browsable=yes

Let's restart the server

sudo systemctl restart smbd

An example of setting up a resource that has symlink to the user folder ( /srv/samba/media/video » /home/proft/video)

Path=/srv/samba/media guest ok=yes read only=yes browsable=yes force user=proft

Client setup

Viewing Computer Shares

Smbclient -L 192.168.24.101 -U%

Another way to connect for anonymous user with command line

Smbclient -U nobody //192.168.24.101/public ls

If the server is configured with more than high level security, you may need to pass a username or domain name using the -W and -U options, respectively.

Smbclient -L 192.168.24.101 -U proft -W WORKGROUP

Mounting a samba share

# create a mount point mkdir -p ~/shares/public # mount a resource # for anonymous user nobody mount -t cifs //192.168.24.101/public /home/proft/shares/public -o user=nobody,password=,workgroup= WORKGROUP,ip=192.168.24.101,utf8 # for user proft mount -t cifs //192.168.24.101/public /home/proft/shares/public -o user=proft,password=1,workgroup=WORKGROUP,ip=192.168. 24.101,utf8

More better passwords store in separate file

# sudo vim /etc/samba/sambacreds username=proft password=1 username=noboy password=

Set permissions to 0600

sudo chmod 0600 /etc/samba/sambacreds

New line to mount

Mount -t cifs //192.168.24.101/public /home/proft/shares/public -o user=proft,credentials=/etc/samba/sambacreds,workgroup=WORKGROUP,ip=192.168.24.101

And an example for /etc/fstab

//192.168.24.101/public /home/proft/shares/public cifs noauto,username=proft,credentials=/etc/samba/sambacreds,workgroup=WORKGROUP,ip=192.168.24.101 0 0

Open resource in file manager Nautilus/Nemo/etc can be on this path smb://192.268.24.101.

If Nemo writes Nemo cannot handle "smb" locations. means the package is missing. gvfs-smb.

Access to the server from Windows and Android client

Under Windows, you can find out the workgroup from the console using

Net config workstation

You can open resources on a remote machine by typing in the Explorer line (Explorer) or in the Run (Start - Run) UNC address: \192.168.24.101 .

On Android, you can connect to the server using ES File Explorer , on the Network tab, add the server, just by IP (without specifying the scheme, smb). Then you can open shared resources. For statistics: HDRIP-movie runs without slowdown.

Extra reading

The main configuration file for Samba is /etc/samba/smb.conf. The initial configuration file has a significant amount of comments to document the various configuration directives.

Not all possible options are enabled in the default settings file. See the guide man smb.conf or the Samba FAQ Collection for more details.

1. First change the following key/value pairs in the section /etc/samba/smb.conf file:

Workgroup=EXAMPLE ... security=user

Parameter security is significantly lower in the section and is commented out by default. Also replace EXAMPLE to something more appropriate for your environment.

2. Create a new section at the end of the file, or uncomment one of the examples for the directory you want to share:

Comment = Ubuntu File Server Share path = /srv/samba/share browsable = yes guest ok = yes read only = no create mask = 0755

    comment: A short description of the shared resource. Used for your convenience.

    path: path to the shared directory.

    This example uses /srv/samba/sharename because, according to the File System Hierarchy Standard (FHS), the /srv directory is where all data related to this site should reside. Technically, a Samba share can be placed anywhere in the file system where file access restrictions allow, but following the standards is recommended.

    browsable: Allows Windows clients to view the contents of a shared directory using Windows Explorer.

    guest ok: Allows clients to connect to the shared resource without specifying a password.

    read-only: Specifies whether the resource is read-only or write-only. Write privileges are available only when specified no, as shown in this example. If the value yes, then access to the resource will be read-only.

    create mask: determines what permissions will be set for new files that are created.

3. Now that Samba is configured, you need to create a directory and set permissions on it. Type in terminal:

sudo mkdir -p /srv/samba/share sudo chown nobody.nogroup /srv/samba/share/

parameter -p tells mkdir to create the full directory tree if it doesn't exist.

4. Finally, restart the samba services to apply the new settings:

sudo restart smbd sudo restart nmbd

Now you can find ubuntu file server with a Windows client and browse its shared directories. If your client doesn't show your shares automatically, try accessing your server by its IP address, eg \\192.168.1.1, from a Windows Explorer window. To test that everything works, try creating a directory inside your share from Windows.

To create additional shares, create a new section in /etc/samba/smb.conf and restart Samba. Just make sure the shared directory is created and has the correct permissions.

Shared resource "" and way /srv/samba/share are just examples. Set the resource name and directory name to match your environment. It's a good idea to use the name of the resource as the name of its directory in file system. In other words, the resource can be specified as for the /srv/samba/qa directory.

A computer