can't access network share (windows accessing raspberry pi)
I wrote a bootable Pi OS onto a Micro-SD card for my raspberry pi, with the raspberry pi imager download for windows
and a usb sd card reader..
And that worked.
I put the Micro-SD card in the Pi, and the OS started.
I got SSH started.
$ sudo systemctl enable ssh
$ sudo systemctl start sshAnd sudo systemctl status ssh shows it.
To SSH in, I did sudo passwd pi and set a password for that user. From Windows cygwin I did SSH pi@192.168.0.20 and I've SSHd in as user 'pi' and made another user too from the pi, with the adduser command. SSH is fine. From Windows, I can transfer files to and from the Pi with FileZilla as that supports the SSH form of FTP -SFTP.
I want to transfer files fairly seamlessly between Windows and the Pi, and I want to map a network drive.. So i'm trying to set up SAMBA on the Pi.
From what I understand , Pi OS is debian based but i've been looking at Pi specific websites for instructions..
Looking at this for the commands to get SAMBA running
I did sudo apt-get install samba samba-common-bin
and sudo systemctl start nmbd
and I tried sudo systemctl status smbd.service and sudo systemctl status nmbd and it seems to be running.
And once SAMBA ran, I tried \192.168.0.20 and it opened an explorer window up and showed the network printer.
So I looked into sharing a directory from the pi.
I tried what it said here about adding this to /etc/samba/smb.conf
[share]
Comment = Pi shared folder
Path = /share
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yesI used that though changed the directory to share.
I changed it to PATH = ~/share
and I made a directory ~/share and did chmod 777 on it, or as that link suggested, 1777. Though I used chmod to do set the permission and that link used mkdir to both create and set permission.
I did sudo systemctl restart smbd.service after editing that samba configuration file.
The directory appears when I do \192.168.0.20 , i.e. the directory shows as an icon, but I get an error when I double click that directory/folder, it says "Windows cannot access \192.168.0.20/share Check the spelling of the name"
1 Answer
You have to include the full path and not use ~/
So, /home/pi/blah and not ~/blah
changing to full path, in the samba configuration file, so using /home/pi/blah worked.
[share]
Comment = Pi shared folder
Path = /home/pi/share
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes(i.e. not Path = ~/share )
1