User Tools

Site Tools


raspberrypi:samba

This is an old revision of the document!


Install samba in the raspberry pi

The problems I've run into are because you have to install two packages, not only one:

sudo apt-get install samba
sudo apt-get install samba-common-bin

Note: if you don't install the later package samba-common-bin you won't find the program smbpasswd which is critical to create a user. Ok, if you want to have all the files open to the public, it might won't be neccesary.

After this, modify the /etc/samba/smb.conf file to include your own share:

[workspace]
        path = /home/rluna/workspace
        read only = no
        writeable = yes
;       browseable = yes
        valid users = rluna

Then, create a user:

smbpasswd -a PUT-YOUR-USERNAME-HERE

Restart the service:

# /etc/init.d/samba/restart

And you are ready to mount from another machine:

sudo mount -t cifs //192.168.1.4/workspace /mnt -o user=REMOTE-USERNAME-GOES-HERE,uid=LOCAL-OWNER-OF-FILES,gid=LOCAL-GROUP-OF-FILES

Some advices to install in a permanent mount point

Edit your fstab file and add the following:

//192.168.1.4/workspace /your/local/dir   cifs     credentials=/some/secret/file/.rasp_creds,_netdev,uid=LOCAL-USER-FOR-FILES,gid=LOCAL-GROUP-FOR-FILES   0  0

The file .rasp_creds must have the following:

#
# credentials for the raspberry pi shared server
#
user=REMOTE-USERNAME
password=REMOTE-PASSWORD-YOU-SET-WITH-SMBPASS

~~DISQUS~~

raspberrypi/samba.1419414128.txt.gz ยท Last modified: 2022/12/02 22:02 (external edit)