Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samba_file_share.md #2206

Merged
merged 1 commit into from
Jul 29, 2024
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
22 changes: 11 additions & 11 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: Steven Spencer
contributors: Steven Spencer, Ganna Zhyrnova
tested_with: 9.4
tags:
- file transfer
Expand All @@ -10,7 +10,7 @@ tags:

## Introduction

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.
If you have ever dealt with Windows systems, you are likely 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

Expand All @@ -22,13 +22,13 @@ dnf install -y samba

## Setting up a share

First make a directory you want to share with Windows clients:
First, make a directory you want to share with Windows clients:

```bash
mkdir /var/store
```

Next 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 @@ -43,7 +43,7 @@ Now configure Samba:
vi /etc/samba/smb.conf
```

In the `smb.conf` file navigate to the bottom and insert the following:
In the `smb.conf` file, navigate to the bottom and insert the following:

```bash
[Share]
Expand All @@ -58,11 +58,11 @@ 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 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`.
* `writable` is to allow clients writing access. If you want to allow write access, set this to `yes`.
* `read only` marks 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:
o test the configuration, you can run the following:

```bash
testparm
Expand Down Expand Up @@ -90,12 +90,12 @@ You can access the Samba share using the following URI (Note: replace `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 notebook:
`SERVER_IP` on the author's home network is `172.20.0.100`, so while the instructions vary based on an 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)

All files accessible on the server are also available on client machines.

## Conclusion

While SMB has a reputation of being Microsoft-centric, SMB is actually an industry standard and your Samba share can be accessed from Linux, Mac, BSD and even mobile devices. So congratulations, you are sharing your server's files now!
While SMB has a reputation for being Microsoft-centric, it is an industry standard, and your Samba share can be accessed from Linux, Mac, BSD, and even mobile devices. So congratulations, you are sharing your server's files now!
Loading