Raspberry Pi Remote Access

when i try this i get the message "[error writing /etc/samba/smb.conf: permision denied]". how do i fix this?
Pierror.JPG
 

mishra

Rising Star
Type sudo before your command? As in: $ sudo nano /etc/samba/smb.conf
Looks like you've open file editor without privileges and that's what stops you from writing the file.
 
Last edited:
ok i can now edit the file, but i cant make it use the usb, i have added anouther share file at first with the same values as the one you said to make eraliar and then with diferent values, i chaged public to yes and create/directory mask.
 

mishra

Rising Star
Connect USB drive to your rpi and show me output of this command:
$ sudo fdisk -l

edit:
did you manage to mount your USB drive but cant see it under samba share?
...or you having problems with mounting the USB drive to folder?
 
Last edited:
I have mounted the drive, but i cant conect it to samba.
the code gave the output:

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open -: No such file or directory
 

mishra

Rising Star
Can you please type this command and show me it's output:
$ sudo df -h

This way I can see where the drive is mounted and what device USB got assigned.
Then I want you to paste me contents of your /etc/samba/smb.conf file ... but I only need that last bit (that [piShare] section)

ps. ah and in puTTy you can "left-click drag" to select any part of terminal (and that automatically copy selections so that you can paste content that way)
 
Last edited:
I got this :
pi@raspberrypi ~ $ sudo df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 6.1G 3.2G 2.7G 55% /
devtmpfs 214M 0 214M 0% /dev
tmpfs 218M 0 218M 0% /dev/shm
tmpfs 218M 8.8M 209M 5% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 218M 0 218M 0% /sys/fs/cgroup
/dev/mmcblk0p5 60M 20M 41M 33% /boot
tmpfs 44M 0 44M 0% /run/user/1000
/dev/sda1 59G 88M 59G 1% /media/pi/F_64BG
/dev/mmcblk0p3 27M 929K 24M 4% /media/pi/SETTINGS
/dev/sdb1 15G 24K 15G 1% /media/pi/RECOVERYUSB

the pi share thing is:
[PiShareStorage]
comment= %h share
path=/media/pi/F_64BG
browseable=yes
writeable=Yes
only guest=yes
create mask=0776
directory mask=0776
public=yes
PS. sorry it took so long to reply I diddn't see the alert.
EDIT: i have just change the /media/pi/F_64BG to /dev/sda1
 
Last edited:

mishra

Rising Star
1. If your drive "/dev/sda1" is already mounted to this location: "/media/pi/F_64BG" as per this output from df -h:

/dev/sda1 59G 88M 59G 1% /media/pi/F_64BG

2. Then what you need to do is to make sure that your samba share is pointing to the right place. First of all do not point to your "/dev/sda1" that is incorrect, it need to point to where it is mounted.
Your smb.conf should look like this:

[piShare]
comment= %h share
path=/media/pi/F_64BG
browseable=Yes
writeable=Yes
only guest=yes
create mask=0777
directory mask=0777
public=no

3. Now I can see you were trying to fiddle with permissions a bit.
To start, keep things simple - give everything full permissions and see if it works. Once you know it's working fine then try to lock it down, to level you are happy with.

What I would do is to give full permision to your mount point (folder):

$ sudo chmod 777 /media/pi/F_64BG

4. Then restart samba to make sure your new configuration has been applied:

$ sudo service smbd stop
$ sudo service smbd start

(or simply: $ sudo service smbd restart )

5. From this point you should have your drive mounted to right folder, folder should have full permission, your samba should then hand out your share to network.. and you should be able to access that folder from Windows machine.

6. I can't see why this would not work for you. I hope I didn't made any typo here as I'm at work and writing this from memory - but it looks fine.
 
ok i have followed your advice and have then attempted to acses the file, but aparently windows cannot acses the file? Any ideas what i might have done wrong?
Error message:
CannotAcsesPi.JPG
Pi share file:

[piShare]
comment= %h share
path=/media/pi/F_64BG
browseable=Yes
writeable=Yes
only guest=yes
create mask=0777
directory mask=0777
public=no
List of codes i have done on the pi:
sudo nano /etc/samba/smb.conf
sudo chmod 777 /media/pi/F_64BG
sudo service smbd stop
sudo service smbd start
sudo nano /etc/samba/smb.conf
'this last one was when i copied the file to here
 

mishra

Rising Star
Can you ping your pi by name?
Open command prompt (on Windows) and type: ping raspberrypi

If it doesn't return ping that's your issue most likely. Try accessing it by IP address rather than it's name?
 
Last edited:

mishra

Rising Star
in your samba config file can you see such line?

usershare allow guests = yes

... or can you paste your whole smb.conf?
 
Last edited:

mishra

Rising Star
I'm not sure why this is not working for you. I've converted my rpi into plex server and i'm not running samba on it anymore - can't check this for you.

Only thing that come to my mind is to check in smb.conf if security = share is not set. If it is, change to:
security = user
map to guest = bad user

You need to add these in global section of your smb.conf file.
Also there is a typo there in your share definition (think I spelled it wrong in my initial post).

Find your [piShare] section in smb.conf and correct:
writeable=Yes
to
writable=yes

*** notice the lack of "e" in the word writable"

Now, restart your samba! and try mapping the drive again. In windows command prompt you can just type:
net use Q: \\192.168.1.11\piShare /PERSISTENT:YES

.. assuming you want your drive to be called Q and your raspbery pi IP address is still 192.168.1.11.
If it doesn't work, can you paste the output of this command?

*** If all fails, I can give you exact copy of my smb.conf file from my test lab server, I have password-less samba set-up there. Maybe you can compare to your version and test it out?
 
Top