Page 1 of 1

Mounting the RevPi as network drive (Samba share)

Posted: 06 Aug 2018, 15:43
by matt.s
Hello,

this is not really a RevPi specific topic, but maybe somebody here could help me out anyways. I would like to create a samba share on my RevPi to transfer files between my Win10 laptop and, more importantly, edit python scripts lying on the RevPi from my Win10 machine using full-grown IDEs.

There are tons of tutorials on setting up samba on the Raspberry Pi and I tried out quite a few. I think the samba is up and running (connecting to the share with smbclient directly on the RevPi works), but I still cannot connect my Win10 laptop to it.

Here's my setup:
Win10 laptop connected to our enterprise network through the wifi card. RevPi Core3 connected to the laptop through an USB-Ethernet-Adapter. DHCP on the wifi card, static IP on both the USB-Ethernet and the RevPi.

The laptop is part of the enterprise domain, the RevPi is not. So when I try to mount a networkdrive, I connect to

Code: Select all

\\<IP_of_the_RevPi>\pi
and check the "Connect using different credentials"-Box. When I click connect, I get a first passwort prompt which tells me I'm trying to connect a share that's in our enterprise domain. So I specify user "\pi" to get rid of the pre-configured enterprise domain and type the password of the samba user "pi" (I set it to be the same as the SSH passwort using "sudo smbpasswd -a pi"). It doesn't seem to make a difference if I use \pi or RevPiXXX\pi as user name.

After that I get a second password prompt but without the "domain: " in the lower part of the prompt, so I only give "pi" as the user and the same password as before. After clicking connect on the sceond password prompt, I get "Error: 0x80070035. Network path not found".

I don't think it has something to do with SMBv1, because I see the same behaviour using a Win7 laptop.

Here's my smb.conf:

Code: Select all

    #======================= Global Settings =======================
    [global]
    ## Browsing/Identification ###
    # Change this to the workgroup/NT-domain name your Samba server will part of
       workgroup = WORKGROUP
    # server string is the equivalent of the NT Description field
       server string = Samba Server
    # This will prevent nmbd to search for NetBIOS names through DNS.
       dns proxy = no
    #### Debugging/Accounting ####
    # This tells Samba to use a separate log file for each machine
    # that connects
       log file = /var/log/samba/log.%m
    # We want Samba to log a minimum amount of information to syslog. Everything
    # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
    # through syslog you should set the following parameter to something higher.
       syslog = 3
    ####### Authentication #######
    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server.
       security = user
    # This option controls how unsuccessful authentication attempts are mapped
    # to anonymous connections
       map to guest = bad user
    #======================= Share Definitions =======================
    [pi]
      path = /home/pi/
      browseable = yes
      writeable = yes
      guest ok = no
      create mask = 0777
      directory mask = 0777

Re: Mounting the RevPi as network drive (Samba share)

Posted: 07 Aug 2018, 09:46
by dirk
When I used to develop a Python application on my Engineering PC and executed it on the RevPi I didn't use Samba but PuTTy.
I used SFTP with key authentication and a batch command list for copying.
Then you have a semi-automatic file transfer. So here is the example that worked like a charm for me:

1) create a SSH key pair with PUTTYGEN.exe
2) add the public key to /home/pi/.ssh/authorized_keys
3) create a text file mycopy.txt, adapt the paths, add more copy commands if you want

Code: Select all

# contents of mycopy.txt
lcd "C:\Project1"
cd /home/pi/project1
mput -r *
# end of mycopy.txt

4) Use PSFTP.EXE for copying according to your IP and file paths

Code: Select all

psftp -b mycopy.txt -i mykey.ppk  pi@192.168.0.100

On top you can put this one liner in a batch file that has a shortcut to execute it quickly.

I've had network problems because our network uses a proxy server. So please check the following (in german) configuration setting:
-> Systemsteuerung -> Internetoptionen -> Verbindungen -> LAN Einstellungen -> Proxyserver für lokale Adressen umgehen

Re: Mounting the RevPi as network drive (Samba share)

Posted: 28 Aug 2018, 06:42
by volz
Hi,

I am using samba on my Rev Pi core 3 with no issues. I am no expert but with it so here is the tutorial I followed maybe it will help you.
http://comfilewiki.co.kr/en/doku.php?id ... ject:index

this is what I enter in file explorer to navigate to the pi "\\192.168.20.12"

this is all I added to the end of my smb.comf file to get it working.

Code: Select all


[usr]
path=/
browseable=yes
read only=no
valid usr=pi
public=yes
hide dot files=yes
follow symlinks=yes
wide links=yes
unix extensions=no




Re: Mounting the RevPi as network drive (Samba share)

Posted: 29 Aug 2018, 12:44
by Timo
How about adding a

Code: Select all

encrypt passwords = yes
into the [global] section? Windows transmits only encrypted login data.