openwrt installs simple sharing of Samba share

1. First you need to upgrade your plug-in

opkg update

2. Install the smaba command

opkg install samba36-server

3. The configuration file path is /etc/samba/smb.conf.template. Comment out invalid users = root in [global].

netbios name = |NAME|
display charset = |CHARSET|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = |CHARSET|
workgroup = |WORKGROUP|
browseable = yes
deadtime = 30
domain master = yes
encrypt passwords = true
enable core files = no
guest account = nobody
guest ok = yes

# invalid users = root

local master = yes
load printers = no
map to guest = Bad User
max protocol = SMB2
min receivefile size = 16384
null passwords = yes
obey pam restrictions = yes
os level = 20
passdb backend = smbpasswd
preferred master = yes
printable = no
security = user
smb encrypt = disabled
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY IPTOS_LOWDELAY
syslog = 2
use sendfile = yes
writeable = yes

4. Set /etc/config/samba

config sambashare



option 'name' 'tmp'
option 'path' '/tmp'
option 'workgroup' 'WORKGROUP'
option 'description' 'OpenWrt'
option 'homes' '1'
option 'read_only' 'no'
option 'guest_ok' 'yes'
option 'create_mask' '0750'
option 'dir_mask' '0750'
option 'users' 'root

5. After setting this configuration, the samba service will be displayed in /etc/samba/smb.conf after it is started. Among them, name is the path used by external devices to access, and path is the real path of this device.

option 'name' 'tmp'
option 'path' '/tmp'
option 'workgroup' 'WORKGROUP'
option 'description' 'OpenWrt'
option 'homes' '1'
option 'read_only' 'no'
option 'guest_ok' 'yes'
option 'create_mask' '0750'
option 'dir_mask' '0750'
option 'users' 'root


After setting this configuration, the samba service will be displayed in /etc/samba/smb.conf after it is started. Among them, name is the path used by external devices to access, and path is the real path of this device.

After the configuration is completed, just start the Samba service.

/etc/init.d/samba start

Set up startup:

/etc/init.d/samba enable

5. Set the root user password:
Samba's shared user password is configured separately. Execute the following command to add root as a shared user, and follow the command prompts to set the shared password.

smbpasswd -a root

In addition, let me talk about it here: The port number generally used by openwrt samba: 139 445

Guess you like

Origin blog.csdn.net/kuaile_0509/article/details/132242817