boelle
Posts: 225
Joined: Wed May 01, 2013 11:52 am

yet another samba connect issue

Tue Nov 06, 2018 11:11 pm

i looked arround but could not find threads that was similar

i have one pi that shares an csv file with internet speed messurements

problem is that i cant access it from a windows pc and i "think" i have set permissions so that everyone should be able to access it and delete and change it, ie i have set it as open as possible because its on my home network with only my machine. the thought behind making it open is to have as little trouble as possible

how i setup the folder itself:

sudo apt-get install samba samba-common-bin
sudo mkdir -m 1777 /internet_monitor
sudo nano /etc/samba/smb.conf

at the end of /etc/samba/smb.conf i added:

[share]
Comment = Pi shared folder
Path = /home/pi/data/internet_monitor
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes

then i did these 2 commands

sudo smbpasswd -a pi
sudo /etc/init.d/samba restart


the complete file: https://pastebin.com/KDwLJQNJ

again i'm going for as little security as possible

now the golden q: what did i miss?

LTolledo
Posts: 1955
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: yet another samba connect issue

Tue Nov 06, 2018 11:25 pm

do you have a "pi" user defined in Winpc?

are you able to connect to the samba share but cannot read/write to it?

another is you may have to set the samba version from 1 to 2, as win10pc cannot (or will not) access samba version 1.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

boelle
Posts: 225
Joined: Wed May 01, 2013 11:52 am

Re: yet another samba connect issue

Tue Nov 06, 2018 11:43 pm

winpc?

is that in /etc/samba/smb.conf ?

when i enter the local ip in windows explore adress bar(tool to access files) i get

Windows cannot access \\192.168.1.180

so no i can not access

if i try access from another raspberry it asks for pi password and that is not what i was after... ie i should be able to access without giving any passwords

i did attach my /etc/samba/smb.conf to the first post

hortimech
Posts: 317
Joined: Wed Apr 08, 2015 5:52 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 9:49 am

You have set up a standalone server and because you have 'map to guest = bad user' set in [global] and 'guest ok = yes' in the share, anybody should be able to access the share. With those settings unknown users are allowed access, but they will still have to attempt to login, read 'man smb.conf' for more info. Users known to Samba will have to provide a valid password or they will be denied access. All unknown users will be mapped to the guest user, usually 'nobody'

Just a few comments on your smb.conf and how you posted it, it has over 250 lines as posted, I reduced this to less than 50 lines with one command 'testparm'. You also added these two lines to your share:

Public = yes
Guest ok = yes

OK, who was it that first suggested adding both of those lines ? whoever it was, can they stop doing it.
'public' is a synonym for 'guest ok' i.e. they mean the same, so you are actually using:

public = yes
public = yes

Or

guest ok = yes
guest ok = yes

hortimech
Posts: 317
Joined: Wed Apr 08, 2015 5:52 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 10:02 am

OOPS, I forgot to mention something, you created the share directory with:

sudo mkdir -m 1777 /internet_monitor

But in the share there is this:

Path = /home/pi/data/internet_monitor

' /home/pi/data/internet_monitor' != '/internet_monitor'

boelle
Posts: 225
Joined: Wed May 01, 2013 11:52 am

Re: yet another samba connect issue

Wed Nov 07, 2018 10:12 am

yes i did sudo mkdir -m 1777 /internet_monitor while i was in /home/pi/data

boelle
Posts: 225
Joined: Wed May 01, 2013 11:52 am

Re: yet another samba connect issue

Wed Nov 07, 2018 10:14 am

about my long /etc/samba/smb.conf

i only added to it i did not touch the file otherwise

hortimech
Posts: 317
Joined: Wed Apr 08, 2015 5:52 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 2:01 pm

boelle wrote:
Wed Nov 07, 2018 10:12 am
yes i did sudo mkdir -m 1777 /internet_monitor while i was in /home/pi/data
Then you created the directory at /internet_monitor, not at /home/pi/data/internet_monitor

The command should have been 'sudo mkdir -m 1777 internet_monitor'

Or 'sudo mkdir -m 1777 ./internet_monitor'

Or 'sudo mkdir -m 1777 /home/pi/data/internet_monitor'

boelle
Posts: 225
Joined: Wed May 01, 2013 11:52 am

Re: yet another samba connect issue

Wed Nov 07, 2018 2:03 pm

doooh

you are correct, i totally missed the /

just evidence that working while half sleeping is a bad idea

andrum99
Posts: 817
Joined: Fri Jul 20, 2012 2:41 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 5:36 pm

You still need to remove these 2 lines from your smb.conf:

Public = yes
Guest ok = yes

The restart samba:

sudo systemctl stop smbd
sudo systemctl start smbd

The first thing to try on the Windows machine is that you can ping your Pi. Enter the following at a command prompt on the Windows machine:

Code: Select all

ping <ip_address>
Where <ip_address> is the IP address of your Pi. Assuming that shows a response, you can then try SMB. In Windows Explorer, type the UNC path to the machine:

Code: Select all

\\<ip_address>
Again, <ip_address> is the IP address of your Pi. That should now prompt you for a username and password as shown in the screenshot below:
Image1.png
Image1.png (76.03 KiB) Viewed 549 times
Enter the username as pi and whatever password you set on the Pi previously for the Pi user (using the smbpasswd command) and click OK. You should then see the share listed in Windows Explorer. (In this case the name of your share is "share" per your smb.conf file).

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 8:35 pm

hortimech wrote:
Wed Nov 07, 2018 2:01 pm
boelle wrote:
Wed Nov 07, 2018 10:12 am
yes i did sudo mkdir -m 1777 /internet_monitor while i was in /home/pi/data
Then you created the directory at /internet_monitor, not at /home/pi/data/internet_monitor

The command should have been 'sudo mkdir -m 1777 internet_monitor'

Or 'sudo mkdir -m 1777 ./internet_monitor'

Or 'sudo mkdir -m 1777 /home/pi/data/internet_monitor'
Why all these totally unnecessary sudo's?

Useless Use of Sudo strikes again!

And note that if you had not used sudo, you'd have noticed the problem right away, since you would get errors for trying to mess with directories in /. sudo actually covered up the mistake, leaving it to strike later.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

hortimech
Posts: 317
Joined: Wed Apr 08, 2015 5:52 pm

Re: yet another samba connect issue

Wed Nov 07, 2018 9:24 pm

The OP used sudo, so I did too. I was just trying to show where he went wrong, so it wasn't multiple uses of sudo, it would have been just one.

The OP could have needed to use sudo, so carping about excessive use of sudo doesn't really help anybody, so you will just have to put up with the use of sudo (do you think I am using sudo a bit excessively ? )

Return to “Troubleshooting”