Samba配置
1.安裝Samba配置
pkg search Samba
samba-nsupdate-9.13.3_1 nsupdate utility with GSS-TSIG support
samba46-4.6.16_1 Free SMB/CIFS and AD/DC server and client for Unix
samba47-4.7.12 Free SMB/CIFS and AD/DC server and client for Unix
samba48-4.8.9_1 Free SMB/CIFS and AD/DC server and client for Unix
pkg install samba48-4.8.9_1
系統中本身有Samba,需要進行安裝及配置
2.啟動Samba配置
1).
service samba_server start
會提示usr/local/etc/smb4.conf文件沒有
2).進入
cd /usr/ports/net/samba48
make clean
make install
接下來就一路默認配置就行,會比較久
最后可能出錯這時候需查看提示,我這提示需要
make deinstall
make reinstall
3).以上安裝之后,/usr/local/etc/下會有個smb4.conf配置文件,如果沒有也沒關系
執行
cp /usr/ports/net/samba48/work/samba-4.8.5/examples/smb.conf.default /usr/local/etc/smb4.conf
3.打開配置添加想要共享的文件夾,編輯smb4.conf;
vi /usr/local/etc/smb4.conf
4.直接輸入GG跳到文件最后,加入自己想要共享的文件夾,內容同Ubuntu系統
[userroot]
comment = userroot's stuff
path = /usr/home/userroot
public = no
broweable = yes
writable = yes
printable = no
create mask = 0777
5.創建samba userroot用戶
輸入密碼
6.在/etc/rc.conf最后加入如下,保存退出
nmbd_enable="YES"
winbindd_enable="YES"
samba_enable="YES"
samba_server_enable="YES"
7.輸入
sh /etc/rc
8.啟動Samba服務
service samba_server start
9.查看Samba狀態
service samba_server status
10.在wind下:
---->計算機
---->映射網絡驅動器
---=>\\IP\共享目錄
---->密碼
到這里就Samba配置完成
重啟Samba服務命令
service samba_server restart
修改密碼:
fsck -p
mount -a
passwd root(或者其他用戶)
exit
卸載安裝的軟件
pkg install pkg-rmleaf
pkg-rmleaf
給字符界面上色
pkg install gnuls
cd /usr/ports/misc/gnuls/
make install clean
make deinstall
make install
bash
/etc/profile
alias ls="gnuls --color=auto --show-control-chars"
csh
/etc/csh.cshrc
alias ls 'gnuls --color=auto --show-control-chars'
注意事項:
1).需要配置靜態IP
2).創建用戶的時候需要給用戶添加權限,不然進入root權限
創建用戶提示如下時:
Invite user into other groups?
將用戶添加為成員的其他組。如果用戶需要管理員權限,請wheel 在此處鍵入。
參考文檔:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html
https://my.oschina.net/michaelshu/blog/1628408