element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum A File Server That Won't Share Shares
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 17 replies
  • Answers 11 answers
  • Subscribers 667 subscribers
  • Views 3278 views
  • Users 0 members are here
  • raspberry_pi
Related

A File Server That Won't Share Shares

oghma
oghma over 7 years ago

I've moved on from my first post "What Are The Basics?"

 

For context, my HW:

Raspberry Pi 3 B+ and a 16Gb mSD card with LITE imaged onto it

Pi-Desktop and a Kingston 480Gb mSATA

USB Keyboard/Mouse combo

10.1” TFT LCD Colour Monitor and a 20cm HDMI cable

 

For context, my environment::

Cat5e with RJ45 ports leading to a HP hub.

(Wi-Fi useless in my old house with thick walls. Not willing to spend a fortune with Wi-Fi extenders. Tried one - doesn't work well.)

What I've done:
used fstab to mount three partitions on the mSATA so they are there at bootup.
lines follow the format:

PARTUUID=5daf9610-09    /mnt/MYLABEL    vfat    defaults,auto,umask=000,users,rw 0 0

where 09 is either 01, 02 or 03 and MYLABEL are the three associated folders in /mnt that are my mountpoints.

 

When I issue a "mount" command I get:

/dev/sda9 on /mnt/MYLABEL type vfat (rw, nosuid,nodev,noexec,relatime,fmask=000,dmask=000,allow_utime=0022,codepage=437,iocharset=asci,shortname=mixed.errors=remount-ro)

where 9 is either 1, 2 or 3 and MYLABEL are the three associated folders in /mnt that are my mountpoints.

The options "nosuid, nodev and noexec" are unexpected, as I thought the opposite values are set by the "default" option.

 

I have confirmed that these mounts are owned by root.

 

I have updated the smb.conf with the following:

[global]

case sensitive = auto

preserve case = yes

short preserve case = yes

netbios name = Pi

server string = RaspFS01

workgroup = MYWKGRP

 

[MYSHARE9]

# share for the partition MYLABEL

path = /mnt/MYLABEL

comment = My sharing folders

browseable = yes

writeable = yes

only guest = no

create mask = 0777

directory mask = 0777

public=no

valid users = MYUSERS

force group = MYWKGRP

 

where 9 is 1, 2 or 3. MYLABEL is the same as the mountpoints above. MYUSERS is a comma seperated list of accounts I created including the user pi (See my next step). MYWKGRP is the workgroup I have on my PC.

 

I have set up users using "adduser" command

I have also made them members of the same groups as user pi

 

I have made the Pi boot with a static IP address and identified the static gateway and static_domain_name_servers as my BT Router.
Once rebooted I can ping google, so I'm still connected to the internet. I've also successfully run the update on the OS.
Now the fun!
When I try to create a mapping from my PC to the Pi, I get "Access Denied" no matter what user I use, even pi.
I ran the diagnostics from my PC and I can find the server, (although it does not show up in Networks). I even confirm the share exists. I just can't map to it.
I try to change the ownership of the mounts from root using the chmod command, but I get "Operation is not allowed". (Yes with sudo.)
I can't seem to allow any user to use these mounts remotely. I can only use them from the Pi! This is not a file server, but just a workstation. I can't find a way to associate MYWKGRP with these mounts with the right permissions.
I've seen a way to explicitly state a user and passwaord in the fstab file, but that would not syncronise with any change of password with the PC. (Not to mention the horrible hole in security!)
Can anyone tell me what I'm missing? Thanks for reading this far.
  • Sign in to reply
  • Cancel
Parents
  • oghma
    0 oghma over 7 years ago

    The story so far:

     

    From the second link sueested by shabaz I've added the following lines to my smb.conf. (some where already there, but I include them for completeness.):

     

    #### Dubugging/Accounting ####

    log file = /var/log/samba/log.%m

    max log size = 100

    syslog = 0

     

    ###### Authentication ######

     

    server role = standalone server

    passdb backend = tdbsam

    obey pam restrictions = yes

    unix password sync = yes

    password program = /usr/bin/passwd %u

    password chat = *Enter\snew\spassword:* *Retype\snew\spassword:* %n\n *password\supdated\ssuccessfully*

    pam password change = yes

    map to guest = bad user

     

    ntlm auth = yes

    encrypt passwords = yes

    smb passwd file = /etc/samba/smbpasswd

    security = user

    dns proxy = no

     

    [homes]

    read only = no

    create mask = 0775

    directory mask = 0775

    valid users = %S

     

    Each share section still looks like this:

     

    [shMYSHARE]

    # share for the partition MYSHARE

    path = /mnt/MYSHARE

    comment = Primary sharing folders

    browseable = yes

    writeable = yes

    only guest = no

    guest ok = no

    create mask = 0777

    directory mask = 0777

    public=no

    valid users = MYUSERS  # user list separated by commas

    force group = MYWORKGROUP

     

    There are three MYSHARE sections.

     

    Now to what happens:

     

    I've managed to create a share called MYUSER which maps to the home directory of the user I log in as. Don't ask me how! I've chmod the permissions on the home directory to be rwxrwxrwx. As you can see above in the [homes] section , I've also changed the masks to 0775. This allows me to map to my 16Gb mSD card home directory. However, I still can't map to my shares. I get a different error message now. :

    image

     

    I'm still thinking this is a permissions issue, but I've given all the permissions I can think of.

     

    The opencanary app suggested by sean looks terrifying. I'm on the Internet all the time, and having a completely open Pi is not what I want to do. I know Unix viruses are far less common, but hackers do things for 'fun'. Of course, they are never 'fun' for the poor victim. I just don't want to line myself up to be one.

     

    Is there a permissions editor to manage the whole set from O/S through samba to files and directories? This sure would make my life a lot easier! So, limiting the advise to the permission issues on the Pi, what do you suggest? What's my checklist? Thank you for reading this far.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • colporteur
    0 colporteur over 7 years ago in reply to oghma

    The configuration provided for use in opencanary I would not recommended for public use. I suggested it as as starting point since it was a known good configuration that last time I used SAMBA. If it worked (i.e. you saw the share and files) than you at least have a working install. By the sound of it, you are not at working.

     

    Can you ping the Pi from the windows desktop PC? i.e. ping <IP Address>

    I noticed you workgroup listing is MYWORKGROUP. Confirm that is what your windows desktop is using. I thought windows default was workgroup but I have limited experience with windows and try to keep it that way.

     

    Sean

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • oghma
    0 oghma over 7 years ago in reply to colporteur

    Sean,

     

    As I stated on my 6-Aug-2018 reply I can ping using both HOSTNAME and IPaddress. I have rechecked this and both still work.

     

    The default Windows workgroup is indeed WORKGROUP. However, I have changed it on both the Pi and my Windows 10 PC to the same thing, (even in the same case).

     

    As I can authenticate to this misterious "User share" that is not mentioned in any of my configuration files, I am assuming that the server and authentication parts work. When I map to the "User share", I don't even have to provide a password, as I have already syncronised the passwords on the Pi and the PC. When I try to map to the Shares, I get the error message above. (9-Aug-2018 reply)

     

    In order to keep my network simple, I have everything on the same subnet as my BT hub. This means that I do not need another router, nore do I need a DNS table. I feel that this would add yet another complication, and I appear to have enough of those to keep me occupied!

     

    Continued below...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • oghma
    0 oghma over 7 years ago in reply to colporteur

    Sean,

     

    As I stated on my 6-Aug-2018 reply I can ping using both HOSTNAME and IPaddress. I have rechecked this and both still work.

     

    The default Windows workgroup is indeed WORKGROUP. However, I have changed it on both the Pi and my Windows 10 PC to the same thing, (even in the same case).

     

    As I can authenticate to this misterious "User share" that is not mentioned in any of my configuration files, I am assuming that the server and authentication parts work. When I map to the "User share", I don't even have to provide a password, as I have already syncronised the passwords on the Pi and the PC. When I try to map to the Shares, I get the error message above. (9-Aug-2018 reply)

     

    In order to keep my network simple, I have everything on the same subnet as my BT hub. This means that I do not need another router, nore do I need a DNS table. I feel that this would add yet another complication, and I appear to have enough of those to keep me occupied!

     

    Continued below...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube