SoFunction
Updated on 2025-04-14

Linux mount Samba sharing method

linux-mount Samba share

1. Linux server

  • Start Samba Sharing Service

2. Install cifs-utils on the client computer

dnf install cifs-utils
# oryum install cifs-utils

3. Mount the shared directory

# Create a hanging directorymkdir /share
# Use the mount command to hang in the shared directory, -t protocol type -o username and password Shared directory access address Mount directorymount -t cifs -o username=samba1,password=1234 //192.168.40.133/share /share

4. View through the df command

# Check the disk statusdf -h
# Display mount status//192.168.40.133/share   17G  5.3G   12G  31% /share

5. Permanent mount (automatic mount when powered on)

  • 5.1 Create a certification file
# Write username, password, and shared domain in turnvim /root/
username=samba1
password=1234
domain=SAMBA
  • 5.2 Modified permissions
# Only root users can view and modifychmod 600 
  • 5.3. Edit /etc/fstab
# Shared directory mount information//192.168.40.133/share  /share                  cifs    credentials=/root/               0 0
#Execute the command to mountmount -a

Summarize

The above is personal experience. I hope you can give you a reference and I hope you can support me more.