* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Monday, August 11, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

    This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

    Six Flags Entertainment Corporation Reports 2025 Second Quarter Results, Provides July Performance Update, and Updates Full-Year Guidance – Business Wire

    Six Flags Reveals Thrilling Q2 2025 Results, Shares July Highlights, and Updates Full-Year Outlook

    ‘Paying homage to Kansas’: Singer-songwriter Dallas Pryor shares music journey – The Topeka Capital-Journal

    Honoring Kansas: Singer-Songwriter Dallas Pryor Shares His Inspiring Musical Journey

    Alabama expands entertainment incentives to boost state’s music and creative industries – Made in Alabama

    Alabama Supercharges Entertainment Incentives to Spark Explosive Growth in Music and Creative Industries

    Peacock’s Biggest Action Show Streams 2 New Episodes Sooner Than You Think – yahoo.com

    Peacock’s Hottest Action Show Drops 2 New Episodes Sooner Than Expected!

    Themed Entertainment Design – Purdue Polytechnic

    Innovative Themed Entertainment Design: Creating Immersive Experiences

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Gas-to-liquids technology can support national resilience – The Strategist | ASPI’s analysis and commentary site

    Unlocking National Strength: How Gas-to-Liquids Technology Drives Resilience

    Micron Technology (MU) Launched a New Memory Chip for Space Application – Yahoo Finance

    Micron Technology Launches Revolutionary Memory Chip Built for Space Exploration

    United Airlines passengers in US delayed after tech glitch halts flights – BBC

    United Airlines passengers in US delayed after tech glitch halts flights – BBC

    Preparing Students for the Technology of Tomorrow – Drug Topics

    Preparing Students Today to Thrive in Tomorrow’s Tech-Driven World

    Technology, History, and Summer Camp at the Rhode Island Computer Museum – abc6.com

    Discover Technology, History, and Summer Camp Adventures at the Rhode Island Computer Museum

    MBU showcases student work at Occupational Therapy Technology Fair – WHSV

    Discover the Most Innovative Student Projects at the Occupational Therapy Technology Fair

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

    This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

    Six Flags Entertainment Corporation Reports 2025 Second Quarter Results, Provides July Performance Update, and Updates Full-Year Guidance – Business Wire

    Six Flags Reveals Thrilling Q2 2025 Results, Shares July Highlights, and Updates Full-Year Outlook

    ‘Paying homage to Kansas’: Singer-songwriter Dallas Pryor shares music journey – The Topeka Capital-Journal

    Honoring Kansas: Singer-Songwriter Dallas Pryor Shares His Inspiring Musical Journey

    Alabama expands entertainment incentives to boost state’s music and creative industries – Made in Alabama

    Alabama Supercharges Entertainment Incentives to Spark Explosive Growth in Music and Creative Industries

    Peacock’s Biggest Action Show Streams 2 New Episodes Sooner Than You Think – yahoo.com

    Peacock’s Hottest Action Show Drops 2 New Episodes Sooner Than Expected!

    Themed Entertainment Design – Purdue Polytechnic

    Innovative Themed Entertainment Design: Creating Immersive Experiences

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Gas-to-liquids technology can support national resilience – The Strategist | ASPI’s analysis and commentary site

    Unlocking National Strength: How Gas-to-Liquids Technology Drives Resilience

    Micron Technology (MU) Launched a New Memory Chip for Space Application – Yahoo Finance

    Micron Technology Launches Revolutionary Memory Chip Built for Space Exploration

    United Airlines passengers in US delayed after tech glitch halts flights – BBC

    United Airlines passengers in US delayed after tech glitch halts flights – BBC

    Preparing Students for the Technology of Tomorrow – Drug Topics

    Preparing Students Today to Thrive in Tomorrow’s Tech-Driven World

    Technology, History, and Summer Camp at the Rhode Island Computer Museum – abc6.com

    Discover Technology, History, and Summer Camp Adventures at the Rhode Island Computer Museum

    MBU showcases student work at Occupational Therapy Technology Fair – WHSV

    Discover the Most Innovative Student Projects at the Occupational Therapy Technology Fair

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Technology

AlmaLinux OS – Samba File Server

May 25, 2024
in Technology
AlmaLinux OS – Samba File Server
Share on FacebookShare on Twitter

Many of you requested more articles about self-hosting and home servers. One of the major use cases is making files available for others in the network. This might be useful to share projects, but also for backups or filling your media library.

Don’t worry. Setting up a Samba file server is easy and done quickly, even without disabling the firewall or SELinux.

AlmaLinux OS

AlmaLinux OS is my preferred Enterprise Linux for personal use. It is based on CentOS Stream, yet provides a stabilized and versioned approach. It is meant to be ABI compatible to Red Hat Enterprise Linux.

For me, it became the best OS when it comes to small office/home office use cases, but also for development and uncritical environments in large enterprise. Therefore, I already published a couple of articles related to AlmaLinux OS.

Samba

Samba is one of the older open source software implementations. In general, it stands for “opening windows for the wider world”. Therefore, I am seeing it as the glue between Windows and Linux environments. This does not mean, you need to use Windows to make use of Samba.

For the sake of this tutorial, I will focus on the Samba file server capabilities. Meaning, we will provide so-called CIFS (Common Internet File System) shares. Yet, Samba can also provide an LDAP server or act as a proxy for the same and much more.

Project

Let’s make our small project somewhat realistic.

As the owner of my home network, I want to share documents between me and family. All family members (Alice, Bob and Carol) should be allowed to upload and download data on a share, no matter if they use Linux or Windows on their workstation.

Pretty simple, right? And this can be solved with the Samba file server easily.

Setup

Finally, we came to the part where some work is done. Let’s set this baby up.

💡

The following setup is based on AlmaLinux OS 9.4 using Samba 4.19.4.

Pre-Requisites

Before going forward, there are some things you should ensure.

update the system beforehandensure that the machine has a proper time/NTP setupensure that the machine has proper DNS settings (meaning it can resolve DNS records or has no DNS resolution configured at all)ensure that you have enough space in /var/lib/samba/ or another desired location for your shares available

There are ways to work around all of the above, but for this tutorial, I assume you have solved them already.

Package installation

Yes, this guide does not start with disabling SELinux. Instead, just let’s install some packages. The command should be pretty straight forward.

# Install Samba packages
$ sudo dnf install samba

Optionally, you can also install the samba-tools package for a more convenient and sophisticated administration command. For this guide, it is not needed.

Configuration

The configuration of Samba can be done in a single file. All Red Hat family distributions also deliver a default configuration and a fully commented example file.

# Show configuration files

$ ls -la /etc/samba/
total 32
drwxr-xr-x. 2 root root 61 May 19 06:34 .
drwxr-xr-x. 99 root root 8192 May 19 06:50 ..
-rw-r–r–. 1 root root 20 Apr 4 20:31 lmhosts
-rw-r–r–. 1 root root 853 Apr 4 20:31 smb.conf
-rw-r–r–. 1 root root 11319 Apr 4 20:31 smb.conf.example

We are interested in the smb.conf file for now. But it is strongly recommended to consult the smb.conf.example file, in case you want to tune the configuration later on. In my case, the smb.conf file will look like this:

[global]
workgroup=SAMBA
security=user

passdb backend=tdbsam

printing=cups
printcap name=cups
load printers=No
cups options=raw

[family]
comment=Family Share
path=/var/lib/samba/shares/family
valid users=@family
create mode=0660
directory mode=0770
browseable=Yes
read only=No

/etc/samba/smb.conf

As you can see, I have disabled the printers, homes and all related sections, but also added a [family] section. The [homes], [globals] and [printers] section are special for samba. Every other section can be configured as you like.

In the above, I configured a single share, which can be accessed from the members of the family group.

To test your configuration, you can use the testparm command. It will tell you if you have an option written or used in the wrong way or used a value that is not supported. Yet, it will not test if your configuration does what you want.

# Run testparm
$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

User creation

Now that we have a valid configuration, we intend to use, we also need to create the users and tell Samba to actually use them. This part is often the most confusing one. We need to have a local user, so we can manage groups and permissions on the filesystem. But we also need a password/user combination to allow these users to log in to the Samba file server.

This might sound complicated, but in reality it is not.

For a small home setup, I will stick with a local user, which will make it easy to create these. The following commands will create our desired local Linux users and groups. The users will be created in a way, so that they do have a home directory, but are not allowed to log in on the console or via SSH.

# Create the users
$ sudo useradd alice –create-home –shell /usr/sbin/nologin
$ sudo useradd bob –create-home –shell /usr/sbin/nologin
$ sudo useradd carol –create-home –shell /usr/sbin/nologin

# Set passwords for users (even though they cannot log in)
$ sudo passwd alice
$ sudo passwd bob
$ sudo passwd carol

# Create the family group
$ sudo groupadd family

# Add users to the group
$ sudo usermod -aG family alice
$ sudo usermod -aG family bob
$ sudo usermod -aG family carol

Next, we need to add the users to the Samba database.

# Create Samba users
$ smbpasswd -a alice
$ smbpasswd -a bob
$ smbpasswd -a carol

# Check if users exist in Samba
$ sudo pdbedit -L
alice:1001:
carol:1003:
bob:1002:

And, that’s it. Let’s head to the next section.

Directory creation

As per our configuration, we want to share the /var/lib/samba/shares/family directory. To do so, we have to create it.

# Create directory
$ sudo mkdir -p /var/lib/samba/shares/family

We also need to set permissions for our new group.

# Change group ownership to “family”
$ sudo chown root:family /var/lib/samba/shares/family

# Allow writing for root and group only
$ sudo chmod 0770 /var/lib/samba/shares/family

# Check permissions
$ sudo ls -ld /var/lib/samba/shares/family/
drwxrwx—. 3 root family 17 May 19 16:10 /var/lib/samba/shares/family/

This should do the trick, mostly.

SELinux considerations

But wait … or maybe … feel free to continue to the guide and come back to this section. In Red Hat family systems, you will find SELinux enabled. Therefore, the above directory is not working as designed. It might not even work at all. So, let’s make a little exercise here. First, we want to check if SELinux is enabled.

$ getenforce
Enforcing

Looking good. Next, we need to understand that SELinux works with context types on a file level. Meaning, each file and directory has a designed context type, which allows programs to access directories only, if they are meant to access it.

We can check this for our directory.

$ ls -ldZ /var/lib/samba/shares/
drwxr-xr-x. 3 root root unconfined_u:object_r:samba_var_t:s0 20 May 19 12:53 /var/lib/samba/shares/

$ ls -ldZ /var/lib/samba/shares/family/
drwxrwxr-x. 2 root family unconfined_u:object_r:samba_var_t:s0 6 May 19 12:53 /var/lib/samba/shares/family/

The context currently in use is “samba_var_t”. Yet, Samba requires us to use the context “samba_share_t”. This is also mentioned in the discussed smb.conf.example file from above and the command man smb.conf. To permanently set the context, we require a command (what else?).

# Configure file context
$ sudo semanage fcontext –add –type samba_share_t /var/lib/samba/shares
$ sudo semanage fcontext –add –type samba_share_t /var/lib/samba/shares/*

This will make the change persistent, but the semanage command does not “enable” these changes on the fly. Instead, a second command is needed.

# Enable/Restore the configure contexts
$ sudo restorecon -R /var/lib/samba/shares

And that’s it. Checking our files again, we can see the context.

# Check the shares
$ ls -ldZ /var/lib/samba/shares/family/
drwxrwxr-x. 2 root family unconfined_u:object_r:samba_share_t:s0 6 May 19 12:53 /var/lib/samba/shares/family/

And yes, you also need to this, if your desired location is located in the /samba, /srv/shares or wherever you desire to have them.

Services

Finally, we can start the services. This will start Samba, read our configuration and basically make Samba available.

# Start & enable Samba and Netbios
$ sudo systemctl enable –now smb.service
$ sudo systemctl enable –now nmb.service

In case you don’t have a firewall enabled on your (which may be a bad idea), you are done here. Everything should work as expected.

Firewall

In case you have the firewalld daemon enabled, you require one more step to complete the setup.

# Allow Samba traffic
$ sudo firewall-cmd –add-service samba
$ sudo firewall-cmd –add-service samba –permanent

And now we are done.

Testing

For testing purposes, you can use lots of tools. One of them is the smbclient command line utility. It is in the samba-client package.

# Check what is available for alice
$ smbclient -U SAMBA/alice -L //localhost
Password for [SAMBAalice]:

Sharename Type Comment
——— —- ——-
family Disk Family Share
IPC$ IPC IPC Service (Samba 4.19.4)
SMB1 disabled — no workgroup available

But, you can also use the Nautilus file manager to mount a Samba share. Just open it and add a new network share.

Screenshot – Nautilus using a samba share

And finally, you can create a file or directory.

Which should be reflected on our machine with the desired permissions.

# Check new directory
$ sudo ls -lZ /var/lib/samba/shares/family/
total 0
drwxrwx—. 2 alice alice system_u:object_r:samba_share_t:s0 6 May 19 16:10 foo

But wait, this directory is created for Alice only. What, if we want each directory to be owned by our “family” group? Easy enough. Just change the smb.conf file to the below.

[global]
workgroup=SAMBA
security=user

passdb backend=tdbsam

printing=cups
printcap name=cups
load printers=No
cups options=raw

[family]
comment=Family Share
path=/var/lib/samba/shares/family
valid users=@family
create mode=0660
directory mode=0770
force group=family
browseable=Yes
read only=No

After disconnecting and reconnecting to your samba share, everything should be as you like.

# Show effective permissions
$ sudo ls -lZ /var/lib/samba/shares/family/
total 0
drwxrwx—. 2 alice family system_u:object_r:samba_share_t:s0 6 May 19 16:20 bar
drwxrwx—. 2 alice alice system_u:object_r:samba_share_t:s0 6 May 19 16:10 foo

Docs & Links

Samba is a vast topic, and I may add at least 10 more articles digging into all the details. Yet, there are some awesome resources already out there. Same can be said about SELinux.

smb.conf

4.7. SELinux Contexts – Labeling Files Red Hat Enterprise Linux 7 | Red Hat Customer Portal

Access Red Hat’s knowledge, guidance, and support through your subscription.

Red Hat Customer Portal

How to share files with Samba

Samba provides easy, flexible, cross-platform, and open source collaboration across your organization.

Enable Sysadminskenlon

How To Force User/Group Ownership Of Files On A Samba Share – The Geek Diary

You have a disk directory shared among Linux and Microsoft Windows clients. Multiple users need access to this directory share, but when files are created or modified from the Linux clients the Linux file permissions are applied making it difficult or impossible for the Windows clients to access these files. You would like to share these disk resources in a homogeneous fashion.

admin

Conclusion

With this rather long article, you should be all set up for your first file server. I will add another article, discussing NFS, for sure. And maybe I will find some more opportunities to talk about Samba.

Said that, how do you share files at home? How do you sync between your TV, Windows and Linux devices? Do you use Samba? Something else? Let me know, I am eager to find out how you do things and what can be added to the blog.

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://blog.while-true-do.io/almalinux-os-samba-file-server/

Tags: AlmaLinuxSambatechnology
Previous Post

Email.ml – Minimalist Temporary Email

Next Post

You are lucky, full moon tonight

Plastisphere provides a unique ecological niche for microorganisms in Zostera marina seagrass meadows – Nature

Plastisphere provides a unique ecological niche for microorganisms in Zostera marina seagrass meadows – Nature

August 11, 2025
‘The best solution is to murder him in his sleep’: AI models can send subliminal messages that teach other AIs to be ‘evil,’ study claims – Live Science

AI Models May Secretly Teach Each Other to Be ‘Evil’ Through Subliminal Messages, Study Warns

August 11, 2025
Concerns Emerge Over Potential Cancer Links to Drugs Like Ozempic – ScienceAlert

Concerns Emerge Over Potential Cancer Links to Drugs Like Ozempic – ScienceAlert

August 11, 2025
Exploring the Links Between Demographics, Lifestyle, Comorbidities, Prediabetes, and Mortality – BIOENGINEER.ORG

How Demographics, Lifestyle, and Health Conditions Shape Prediabetes and Mortality Risk

August 11, 2025
Gas-to-liquids technology can support national resilience – The Strategist | ASPI’s analysis and commentary site

Unlocking National Strength: How Gas-to-Liquids Technology Drives Resilience

August 11, 2025
From the Texas offensive line to Michigan RB room, these non-QB questions need answers ahead of 2025 season – CBS Sports

Crucial Position Battles from Texas’ Offensive Line to Michigan’s Running Backs That Will Define the 2025 Season

August 11, 2025
Activists plant war protest doll inside Disneyland – SFGATE

Activists Ignite Outrage by Planting War Protest Doll Inside Disneyland

August 11, 2025
Trump, when in trouble, throws tantrums. The economy is his latest conniption. | Opinion – USA Today

Trump, when in trouble, throws tantrums. The economy is his latest conniption. | Opinion – USA Today

August 11, 2025
This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

This LA singer performed at Trump casinos. Now he’s a retired bus driver in Acadiana. – The Advocate

August 11, 2025
Laramie County health and food inspections (8/1/25–8/7/25) – Cap City News

Laramie County Health and Food Inspections: Key Findings from August 1-7, 2025

August 11, 2025

Categories

Archives

August 2025
MTWTFSS
 123
45678910
11121314151617
18192021222324
25262728293031
« Jul    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (765)
  • Economy (787)
  • Entertainment (21,664)
  • General (16,402)
  • Health (9,826)
  • Lifestyle (798)
  • News (22,149)
  • People (789)
  • Politics (797)
  • Science (16,001)
  • Sports (21,285)
  • Technology (15,768)
  • World (770)

Recent News

Plastisphere provides a unique ecological niche for microorganisms in Zostera marina seagrass meadows – Nature

Plastisphere provides a unique ecological niche for microorganisms in Zostera marina seagrass meadows – Nature

August 11, 2025
‘The best solution is to murder him in his sleep’: AI models can send subliminal messages that teach other AIs to be ‘evil,’ study claims – Live Science

AI Models May Secretly Teach Each Other to Be ‘Evil’ Through Subliminal Messages, Study Warns

August 11, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version