Jump to content

Samba, cant access a share

Ive set up samba on my rpi, and I cant acces the share

 

On windows, I open run, run \\ip\MyShares, and i get a windows error saying "you do not have permission to access \\ip\MyShares. Contact your network administrator to request access."

I dont have a network admin, this should work fine

On linux, i can connect but whenever I try to do anythig to the filesystem I get "NT_STATUS_ACCESS_DENIED"

 

Whats up? it shouldve been simple.

Its probably something with network setting on my router, but I have no idea what

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Does the user (via Samba) have permission to access/modify the RPI's directory?

Main: AMD Ryzen 7 5800X3D, Nvidia GTX 1080 Ti, 16 GB 4400 MHz DDR4 Fedora 38 x86_64

Secondary: AMD Ryzen 5 5600G, 16 GB 2667 MHz DDR4, Fedora 38 x86_64

Server: AMD Athlon PRO 3125GE, 32 GB 2667 MHz DDR4 ECC, TrueNAS Core 13.0-U5.1

Home Laptop: Intel Core i5-L16G7, 8 GB 4267 MHz LPDDR4x, Windows 11 Home 22H2 x86_64

Work Laptop: Intel Core i7-10510U, NVIDIA Quadro P520, 8 GB 2667 MHz DDR4, Windows 10 Pro 22H2 x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, svmlegacy said:

Does the user (via Samba) have permission to access/modify the RPI's directory?

it should, i put read only to no and guest ok to yes, what else would i need to do?

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, HelpfulTechWizard said:

it should, i put read only to no and guest ok to yes, what else would i need to do?

Ensure the file directory itself has access for rwx on all users?

Main: AMD Ryzen 7 5800X3D, Nvidia GTX 1080 Ti, 16 GB 4400 MHz DDR4 Fedora 38 x86_64

Secondary: AMD Ryzen 5 5600G, 16 GB 2667 MHz DDR4, Fedora 38 x86_64

Server: AMD Athlon PRO 3125GE, 32 GB 2667 MHz DDR4 ECC, TrueNAS Core 13.0-U5.1

Home Laptop: Intel Core i5-L16G7, 8 GB 4267 MHz LPDDR4x, Windows 11 Home 22H2 x86_64

Work Laptop: Intel Core i7-10510U, NVIDIA Quadro P520, 8 GB 2667 MHz DDR4, Windows 10 Pro 22H2 x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, svmlegacy said:

Ensure the file directory itself has access for rwx on all users?

I Chmod0777ed the first; that should be enough

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, svmlegacy said:

Ensure the file directory itself has access for rwx on all users?

Jesus christ, don't do that.

 

"sudo chmod -R 755 /dir/here "should be more than fine, at most do 775.

 

Then do "sudo chown $USER:samba /dir/here"

 

Finally do "sudo usermod -aG samba yourusername" to add yourself to the samba group.

 

If that doesn't work then its probably a configuration issue. When connecting through Windows do you check the "connect using different credentials" box and enter your Pi account user & password?

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

51 minutes ago, Master Disaster said:

If that doesn't work then its probably a configuration issue. When connecting through Windows do you check the "connect using different credentials" box and enter your Pi account user & password?

Yep

 

54 minutes ago, Master Disaster said:

Then do "sudo chown $USER:samba /dir/here"

slight issue here.

I get a chown: invalid group '"myusername":samba' erroe when I run this

55 minutes ago, Master Disaster said:

Finally do "sudo usermod -aG samba yourusername" to add yourself to the samba group.

this also says samba group doesnt exist.

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, HelpfulTechWizard said:

Yep

 

slight issue here.

I get a chown: invalid group '"myusername":samba' erroe when I run this

this also says samba group doesnt exist.

Gimme an hour or so and I'll install SAMBA onto my desktop and run through a basic setup from scratch. The instructions above are from my NAS which is a Synology so probably has some weird stuff going on.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, HelpfulTechWizard said:

Yep

 

slight issue here.

I get a chown: invalid group '"myusername":samba' erroe when I run this

this also says samba group doesnt exist.

So yeah, literally everything I said was wrong 😄

 

Here's how it should be done.

 

First disable samba, "sudo systemctl disable --now samba", "sudo systemctl stop smb", sudo systemctl stop nmb"

 

Next create yourself a fresh smb.conf file, "sudo nano /etc/samba/smb.conf"

 

Add the following to it

[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = MYGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
   hosts allow = 192.168.1. 127.

# this tells Samba to use a separate log file for each machine
# that connects
   logging = systemd

# for security we will force samba to only use SMB v2 or higher,
# enabling SMB V1 support is a HUGE security risk. You can adjust
# the max version here too (disabled by default)
  server min protocol = SMB2_02
#  server max protocol = SMB3
# IMPORTANT NOTE - Sinca Samba 4.1.1 the minimum allowed smb version is V2.0, V1/NTLM support is disabled for security reasons

# Backend to store user information in. New installations should 
# use either tdbsam or ldapsam. smbpasswd is available for backwards 
# compatibility. tdbsam requires no further configuration.
   passdb backend = tdbsam

# These options force samba to inherit ownership and permissions from its 
# parent folder. These 2 should usually be used together
#  inherit owner = unix only 
#  inherit permissions = yes 
 
# Otherwise use the following settings to hard define file masking options
#  create mask = 0664
#  directory mask = 2755
#  force create mode = 0644
#  force directory mode = 2755

Change the section that reads "workgroup" to whatever you want, usually WORKGROUP

 

Change the section that reads "hosts allow" to your subnet or just comment it out to allow any and all connections.

 

Take a look at the permissions section, you can use one or the other but not both, neither should be fine too.

 

Save the file with CTRL+X, Y, enter.

 

Start samba again, "sudo systemctl enable --now smb", "susdo systemctl enable --now nmb"

 

Next you need to create a samba user, do this with "sudo smbpasswd -a username"

*Note this is seperate from your main account but you can use the exact same username and password if you like

 

Then set the new users password, "sudo smbpasswd username"

 

One more restart for good look, "sudo systemctl restart smb", "sudo systemctl restart nmb"

 

Then you should be able to log in to samba from any host using the user and pass you just created.

 

Edit -

 

Once finished please run "sudo systemctl status smb" and if you get errors about printer failing then add the following to the bottom of the [GLOBAL] section of smb.conf file

 

load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
show add printer wizard = no

 

Edit 2 -

 

Might also help if I showed how to actually create shares, here are my 3 examples, add them to the bottom of smb.conf

 

# My custome shares
[Apps]
  comment = Appslications Drive
  path = /mnt/b6c9d0fe-edc5-4be4-b979-f1749701ecb5
  public = yes
  writable = no
  write list = @root
  create mask = 0664
  directory mask = 2775
  force create mode = 0664
  force directory mode = 2775

[Games]
  comment = Games Drive
  path = /mnt/4edbbf5c-4349-4832-8dca-f8c4a7bd9797
  public = yes
  writeable = no
  write list = @root
  create mask = 0664
  directory mask = 2775
  force create mode = 0664
  force directory mode = 2775

[Misc]
  comment = Misc Drive
  path = /mnt/e7b65b3f-fac4-4c30-af1d-9491b9863033
  public = yes
  writeable = no
  write list = @root
  create mask = 0664
  directory mask = 2775
  force create mode = 0664
  force directory mode = 2775

 

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×