当前位置:网站首页>Openwrt quick configuration Samba
Openwrt quick configuration Samba
2022-07-24 05:52:00 【Xiaotao 29】
OpenWRT Quick configuration Samba
These two days, I want to use Xunlei download treasure again , Thinking that the original developer may have run away , So I found one on the Internet OpenWRT On the bag brush of .
Found after power on Samba I have to configure myself , Studied all afternoon , Basically learned the method , Share with you .
install Samba
Sign in Luci, stay “ System ” tab -“ software package ” Update the list , Then click available packages , Search and install the following three software .
- samba36-server
- luci-app-samba
- luci-i18n-samba-zh-cn
First of all 、 Two must be installed , The third is the language pack , Good English can put “zh-cn” Change to “en” English version , The language pack interface is in the same language .
Configure anonymous Services
“ System ” Tab “TTYD terminal ”, If there is no , Can download putty, then ssh Log in to the router IP.
notes :Samba The configuration of the service consists of two files , One is /etc/config/samba, Two is /etc/samba/smb.conf.template, After the service is started, it will first read the No. 1 file , Then read file number two , Generate /etc/samba/smb.conf file , Finally, run the service .
according to Samba Service read configuration method , Need to change one of the above 、 Document No. 2 . Here is the template configuration , Simply overwrite the template with the original configuration . The operation is as follows .
- stay ssh Enter... In the window
vim /etc/config/samba, Edit file No. 1 .
It can be found that the original configuration file should be similar to the configuration file to be modified , For convenience , Keyboard entry :%d And return , Empty the file directly . Press again i, Enter edit mode , Copy the following , stay ssh Right click on the interface , Paste . Press Esc, Input again :wq, Pay attention to this time wq Will be displayed in ssh The bottom of the window , Press enter to save and exit .
notes : The following configuration template refers to U The disk mount point can be at “ System ” tab -“ Mount point ” View in , Find the capacity in the mount point corresponding to the one you inserted U Row of disc , Then copy the value of the mount point column of this row to the above position to replace the original value . Generally speaking, if only one router is inserted U disc , The mount point will be located in the template , But there may be situations that do not apply , It is suggested to check and confirm by yourself .
samba The file configuration template is as follows :
config samba
option name 'OpenWrt'
option workgroup 'WORKGROUP'
option description 'OpenWrt'
option homes '1'
config sambashare 'FlashDisk' ## The quotation marks can be changed to the desired shared name , It is not recommended to have Chinese
option name 'FlashDisk' ## The quotation marks can be changed to the desired shared name , It is not recommended to have Chinese , Same as above
option path '/mnt/sda1' ## Change the quotation mark to U Disk mount location
option read_only 'no'
option guest_ok 'yes'
option create_mask '777'
option dir_mask '777'
- stay ssh Enter... In the window
vim /etc/samba/smb.conf.template, Edit Document No. 2
The operation steps of Document No. 2 and Document No. 1 are the same , But there is nothing in Document No. 2 that needs to be modified , You can paste it directly and save it .
Keyboard entry :%d And return , Empty the file directly . Press again i, Enter edit mode , Copy the following , stay ssh Right click on the interface , Paste . Press Esc, Input again :wq, Enter, save and exit .
[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 = 8192
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 SO_RCVBUF=960000 SO_SNDBUF=960000
syslog = 2
use sendfile = yes
use mmap = yes
writeable = yes
disable spoolss = yes
host msdfs = no
strict allocate = No
Last , stay ssh Window type /etc/init.d/samba restart And return ; Or in “ System ”-“ Start item ” Find “samba”, Click restart , restart Samba service , The configuration takes effect .
stay win10 Run window input \\192.168.1.1 You can access the router U What's on the plate . Be careful ,\\ There must be , Followed by the router IP.
thus ,Samba The basic configuration of the service is over . And I also found that ,Samba Services can add passwords , For netizens who have deployed intranet penetration services on the router , It is very easy for hackers to steal without adding service passwords U The data in the disk , So you can refer to the following steps to Samba Add a layer of password to the service .
Promotion operation
Samba The service requires a separate account , So your account when logging into the router is useless .
Careful you should find out , A line is commented in the above No. 2 file configuration template #invalid users = root, If you cancel the comment on this line , It means that you will not be able to use root Add password to the account , In this way, we also need to samba Add a separate account for the service , It's troublesome for individual users , So let me introduce the direct use root Account No samba How to add a password to the service .
In fact, the first step should be to comment out the invalid users = root, Skip this step directly . stay ssh Enter... In the window smbpasswd -a root, After entering, the prompt for entering the password will pop up at the bottom , Enter your password at this time and press enter , Again , It can be root Account settings samba Password for the service . Be careful , No characters are displayed when entering the password .
We need to cancel Samba Options configured in the service to allow anonymous access , Input vim /etc/config/samba, Edit file No. 1 , take option guest_ok 'yes' Medium yes Change to no, Press Esc, Input again :wq, Enter, save and exit . Of course you can “ Network storage ”-“ Network sharing ” Share one row of the shared directory you set “ Allow anonymous users ” Option uncheck , spot “ Save and apply ”, Reach and vim Configure the same effect .
Last , restart samba service . stay ssh Window type /etc/init.d/samba restart And return ; Or in “ System ”-“ Start item ” Find “samba”, Click restart .
win10 Access encryption Samba The way of service is the same as that of anonymity , But the system will ask for the account password before accessing , Account No root, Password the password set for yourself , Check save account and password , Next time you visit, you can double-click to enter .
above , I worked it out in the afternoon Samba Service configuration method , Can help some people who haven't been touched Samba Netizens quickly complete the basic configuration , But due to my limited time , No more in-depth research , The problems in my above methods can be pointed out in the comments .
边栏推荐
- 【树莓派4B】七、远程登录树莓派的方法总结XShell,PuTTY,vncServer,Xrdp
- "Statistical learning methods (2nd Edition)" Li Hang Chapter 15 singular value decomposition SVD mind map notes and after-school exercise answers (detailed steps) SVD matrix singular value Chapter 15
- 多商户商城系统功能拆解08讲-平台端商品分类
- Multi merchant mall system function disassembly lecture 08 - platform end commodity classification
- GCC 中__attribute__((constructor)和__attribute__(((destructor))的注意事项。
- Sqlserver completely deleted
- 《机器学习》(周志华) 第5章 神经网络 学习心得 笔记
- Zotero快速上手指南
- Authorized access to MySQL database
- Two architectures of data integration: ELT and ETL
猜你喜欢

Multi merchant mall system function disassembly lecture 07 - platform side commodity management

Typora 安装包2021年11月最后一次免费版本的安装包下载V13.6.1

The female colleague of the company asked me to go to her residence to repair the computer at 11 o'clock at night. It turned out that disk C was popular. Look at my move to fix the female colleague's

树莓派大用处,利用校园网搭建一个校园局域网站

西瓜书/南瓜书--第1,2章总结

多商户商城系统功能拆解10讲-平台端商品单位

多商户商城系统功能拆解03讲-平台端商家管理

labelme转voc代码中的一个小问题

【树莓派4B】七、远程登录树莓派的方法总结XShell,PuTTY,vncServer,Xrdp

Multi merchant mall system function disassembly Lecture 10 - platform end commodity units
随机推荐
STM32 DSP库MDK VC5\VC6编译错误: 256, (const float64_t *)twiddleCoefF64_256, armBitRevIndexTableF64_256,
多商户商城系统功能拆解08讲-平台端商品分类
《机器学习》(周志华) 第3章 线性模型 学习心得 笔记
关于卷积神经网络中的“输入通道”和“输出通道”的概念
Add se channel attention module to the network
Multi merchant mall system function disassembly lecture 09 - platform end commodity brands
LSTM神经网络
对接CRM系统和效果类广告,助力企业精准营销助力企业精准营销
On the concepts of "input channel" and "output channel" in convolutional neural networks
自己的一点点小想法——使用MATLAB实现类似环形缓冲器的读取
Xshell远程访问工具
多商户商城系统功能拆解10讲-平台端商品单位
Mysqldump export Chinese garbled code
Likeshop100% open source encryption free B2B2C multi merchant mall system
《机器学习》(周志华)第一章 绪论 笔记 学习心得
西瓜书/南瓜书--第1,2章总结
《统计学习方法(第2版)》李航 第十三章 无监督学习概论 思维导图笔记
Likeshop100%开源无加密-B2B2C多商户商城系统
Canal+kafka实战(监听mysql binlog实现数据同步)
"Statistical learning methods (2nd Edition)" Li Hang Chapter 15 singular value decomposition SVD mind map notes and after-school exercise answers (detailed steps) SVD matrix singular value Chapter 15