debian9-samba-configure-0

Hi guys, this tutorial is a log of how to setup Samba in a Debian9-stretch(Server) environment and Windows client. I go straight into the configurations. Pls refer to Samba Documentation for further information.

1) Check if Samba is already installed:

command: dpkg -l samba

If samba is already installed, you'll get a result as below:

debian9-samba-configure1-1

else if Samba is not installed, use this command to install Samba and Samba client is:

sudo apt-get install samba

sudo apt-get install smbclient

Check if samba is running:

systemctl status smbd

If samba is installed but isn't running, you can start it with

systemctl start smbd

debian9-samba-configure2-1

2) With Samba installed and running, configure samba by adding settings for a new shared directory.

a) on the Linux server, create a new user either via your GUI or command-line

b) add the new user to samba:

smbpasswd -a [mynewsambauser]

you will be prompted for a passwd.

c) fire up a terminal window and cd to /etc/samba; edit filename: smb.conf, don't change anything, just scroll down to the end of the code and add the following:

[ORIGINAL_TOKUNBO]
path = /home/mylinuxguest
comment = LinuxGuest
available = yes
browsable = yes
public = yes
writable = yes
create mask = 0644
directory mask = 0755
forceuser = mylinuxguest

where:

- [ORIGINAL_TOKUNBO] - is the name the share will be identfied as

- path = directory path for the home-directory of my new user account on the server, called "mylinuxguest"
comment = comment

- available, browseable, public, writeable = yes... attributes for the directory

- create mask, directory mask = permissions on the directory

- forceuser = used to "tie" the directory and the user-account name together

NOTE: I prefer adding my own settings just as above, per shared directory, then playing around with the options to see how the shared directory behaves, rather than figuring out what to modify in the default smb.conf file.

3) Access the shared folder:

From your windows client PC, launch a browser and type: \\ {ip-address-of-samba-server) in the address bar.... or in start menu >> search programs and files

debian9-samba-configure3

Comments and clarifications are welcome.

Map the directory on the server to your client PC:

- right click on the shared directory >> Map network drives >> tick reconnect at logon >> Finish

You have no rights to post comments