
Software to be installed:
sudo apt-get install samba samba-common-bin
sudo apt-get install netatalk (optional, for AFP support)
sudo apt-get install avahi-daemon (optional, used to support automatic discovery of computers in the network)
Next is the configuration:
[Samba configuration] /etc/samba/smb.conf file added at the end
[public]
comment = Public Storage
path = /home/pi
read only = no#Anyone has access to modify
#Because it is a public folder, all users are given full permissions, which can be customized
create mask = 0777#Default properties of newly created files
directory mask = 0777#Default properties of newly created folders
guest ok = yes #The default access user name is guest
browseable = yes
For the detailed configuration of Samba, please refer to Reference 1 and Reference 2. Then you can smbd restart . At this time, you can already see the shared file directory through the Internet Neighborhood, but you can't enter it. Prompt to enter a password, try to use a local account can not enter. I checked the information because Samba uses its own set of user account databases. To log in, you also need to add account information to the library. There are two methods:
1. Directly use mksmbpasswd.sh to convert the system user into a Samba user:
cat /etc/passwd | mksmbpasswd.sh >/etc/samba/smbpasswd
2. Use the smbpasswd command to set directly, you need to add a system user first and then use smbpasswd -a username to add a Samba user; smbpasswd -e username to activate the user.
[Netatalk configuration] /etc/netatalk/AppleVolumes.default Method reference 3.
Finally, mount the USB mobile hard disk:
mount /dev/sda1 /home/shares/public/
Sometimes when uninstalling the USB mobile hard disk, it will prompt that the device is busy (Device is busy), just add the -l parameter:
umount -l /home/shares/public/
We are the most professional Raspberry Pi supplier