Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up samba file sharing in raspberry pie

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to set up samba file sharing in raspberry pie. The editor thinks it is very practical, so I hope you can get something after reading this article. Let's take a look at it with the editor.

Samba introduction

Samba is a network protocol for sharing files and printers between unix/linux system and windows operating system. Because it is easy to set up and easy to use, it is very popular in the intranet environment and can be regarded as the intranet version of ftp.

Windows, macos and many desktop versions of linux systems directly inherit the samba client, which makes it easy to add and uninstall samba network disks.

Raspberry pie installation and setup of samba

This section describes how to install and set up samba on a raspberry pie by:

1. Install samba softwar

Installation commands:

Sudo apt update & & sudo apt upgrade & & sudo apt-get install-y samba

two。 Set up samba

The configuration file of samba is * * / etc/samba/smb.conf**,. Its configuration mainly consists of four parts:

Global settings of global:samba software

Homes: system users' home directory sharing settings, default users can access their own home directory

Printers: shared printer settings

User-defined shared directory settings

The first three parts can be changed according to your own needs, or you can keep the default (if you don't understand, please man 5 smb.conf to check the meaning of the field). The following explains the steps for customizing shared directory operations for both public shared directories and custom private directories.

Public shared directory. Add a configuration similar to the following at the end of * * / etc/samba/smb.conf** (the beginning of the # sign is a description): `# configure the segment name, and feel free to take [public]

Share segment comments

Comment = public folder

Shared folder path, required

Path = / public

Allow you to write

Read only = no

Allow anonymous access

Public = yes

Whether it appears in network discovery

Browseable = yes2. Customize the shared directory and add the following configuration: [tlanyan] comment = tlanyan windows file path = / mnt/tlanyan

Does not appear in network discovery

Browseable = no

Anonymous access is prohibited

Public = no writable = yes

Only pi users are allowed to access

Valid users = pi`

After the configuration is complete, sudo systemctl restart smbd restarts the samba service.

3. Client connection

Because windows and macos have built-in support for the samba protocol, accessing the samba folder is very convenient.

Windows: open "my computer", click "add Network Drive" in the menu bar above, click "Select Custom Network location" in the pop-up window, then enter "/ / ip/ folder name" to complete the connection settings according to the boot.

windows连接samba网盘

Macos: open finder-> go to-> Connect to the server, and enter "smb://ip/ shared folder" in the pop-up box:

macos连接samba

If access is set, enter the user name and password as prompted. If correct, you can see the shared folder hanging in the system. Shared folders with write permissions set can be used as local disks, operating exactly the same, and because they are generally on the intranet, there is no delay in speed.

Other

Raspberry pie has only one SD card by default, and you need to use usb external hard drive to complete the home nas task well.

For shared folders, access users should have corresponding permissions, otherwise permission problems may occur

The above is how to set up samba file sharing in raspberry pie. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report