Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/guides/file_sharing/samba_file_share.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Samba Windows File Sharing
author: Neel Chauhan
contributors:
contributors: Steven Spencer
tested_with: 9.4
tags:
- file transfer
Expand All @@ -10,11 +10,11 @@ tags:

## Introduction

If you've ever dealt with Windows systems chances are you're aware of SMB (Server Message Block) for file sharing. If you're a seasoned Linux administrator chances are that you've heard of Samba but if you haven't, [Samba](https://www.samba.org/) is the de-facto open source implementation of SMB to enable file sharing and Active Directory access of Linux machines to Windows networks.
If you have ever dealt with Windows systems chances are you are aware of SMB (Server Message Block) for file sharing. If you are a seasoned Linux administrator chances are that you have heard of Samba but if you have not, [Samba](https://www.samba.org/) is the de-facto open source implementation of SMB to enable file sharing and Active Directory access from Linux machines to Windows networks.

## Installation

You need to install Samba from the `dnf` repositories:
You need to install Samba using `dnf`:

```bash
dnf install -y samba
Expand All @@ -28,7 +28,7 @@ First make a directory you want to share with Windows clients:
mkdir /var/store
```

Subsequently you will set the SELinux labels on the `/var/store` directory:
Next set the SELinux labels on the `/var/store` directory:

```bash
semanage fcontext -a -t samba_share_t "/var/store(/.*)?"
Expand All @@ -37,7 +37,7 @@ restorecon -Rv /var/store

Replace `/var/store` with the directory to be shared.

Next we will configure Samba:
Now configure Samba:

```bash
vi /etc/samba/smb.conf
Expand All @@ -54,13 +54,13 @@ In the `smb.conf` file navigate to the bottom and insert the following:
guest ok = yes
```

If you're unaware of the options above, they are:
If you are unaware of the options above, they are:

* `path` is the directory we are sharing. Set this to your respective directory (`/var/store` in our case).
* `browseable` is to allow clients to browsing access. If you wish to disallow browsing set this to `no`.
* `writable` is to allow clients writing access. If you wish to allow write access set this to `yes`.
* `read only` is to mark the share as read-only. If you wish to allow write or execute access set this to `no`.
* `guest ok` is to allow non-authenticated users access to our share. If you wish to deny guests set this to `no`.
* `path` is the directory we are sharing. Set this to your respective directory (`/var/store` in our case).
* `browseable` is to allow clients to browsing access. If you want to disallow browsing set this to `no`.
* `writable` is to allow clients writing access. If you want to allow write access set this to `yes`.
* `read only` is to mark the share as read-only. If you want to allow write or execute access set this to `no`.
* `guest ok` is to allow non-authenticated users access to our share. If you want to deny guests set this to `no`.

To test the configuration you can run:

Expand All @@ -70,14 +70,14 @@ testparm

## Enabling Samba

Ocne the configuration is okay you will open the Samba port in `firewall-cmd`:
Once the configuration tests OK, open the Samba port in `firewall-cmd`:

```bash
firewall-cmd --permanent --add-service=samba
firewall-cmd --reload
```

Nest, you can enable Samba:
Next, you can enable Samba:

```bash
systemctl enable --now smb nmb
Expand All @@ -87,14 +87,14 @@ systemctl enable --now smb nmb

You can access the Samba share using the following URI (Note: replace `SERVER_IP` with the IP address or FQDN of your machine running Samba):

* Windows: `\\SERVER_IP`
* Linux/Mac: `smb://SERVER_IP`
* Windows: `\\SERVER_IP`
* Linux or Mac: `smb://SERVER_IP`

`SERVER_IP` on the author's home network is `172.20.0.100` so while the instructions vary based on operating system the author will access the new share from their Fedora 40 laptop:
`SERVER_IP` on the author's home network is `172.20.0.100` so while the instructions vary based on operating system, the author will access the new share from their Fedora 40 notebook:

![Fedora 40 Nautilus showing our Samba Share](../images/samba_nautilus.png)

As you can see all files accessible on the server are also available on client machines.
All files accessible on the server are also available on client machines.

## Conclusion

Expand Down