????????在openWrt開發(fā)過程中,PC和OpenWrt之間上傳、下載文件,是一個剛需。Samba 服務(wù)器可以非常方便地實現(xiàn)這個需求。
1,安裝samba36-server和luci-app-samba
opkg install samba36-server luci-app-samba
Openwrt的samba配置是先讀取/etc/config/samba,結(jié)合/etc/samba/smb.conf.template文件,生成 配置文件/etc/samba/smb.conf,用戶只需修改/etc/config/samba和/etc/samba /smb.conf.template文件,然后設(shè)置samba用戶與密碼。
2,編輯/etc/config/samba如下
config samba
option 'name' 'OpenWrt'
option 'workgroup' 'WORKGROUP'
option 'description' 'OpenWrt'
option 'homes' '1'
config sambashare
option 'name' 'openwrt' ###在pc共享文件夾顯示的共享名字
option 'path' '/usr/lib' ##共享路徑
option 'writable' 'yes' ##可寫
option 'read_only' 'no'
option 'create_mask' '0777'
3,修改/etc/samba/smb.conf.template,注釋掉root那行,使之跳過身份驗證
root@OpenWrt:~# vim /etc/config/samba
[global]
netbios name = |NAME|
display charset = |CHARSET|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = utf-8
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.重啟samba
/etc/init.d/samba restart
5, pc添加網(wǎng)絡(luò)驅(qū)動器映射
文章來源:http://www.zghlxwxcb.cn/news/detail-650784.html
?完成后即可同步瀏覽和修改openwrt上的數(shù)據(jù)文章來源地址http://www.zghlxwxcb.cn/news/detail-650784.html
到了這里,關(guān)于openwrt 配置samba服務(wù)器與pc共享文件的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!