Ubuntu 20.04 Samba Server
Ubuntu 安裝 網路工具
> sudo apt install net-tools
> ifconfig
Ubuntu 安裝 Samba Server
於 Windows 10 Command 執行
> net config workstation
會顯示
Workstation domain: WORKGROUP
> apt-get install samba
開放Samba防火牆
> sudo ufw allow 'Samba'
新增Samba Server的使用者 xxx
> smbpasswd -a test
password: YTGHFHG
例如新增一個 root 帳號
> smbpasswd -a root
password: $%&*&$%^$%
設定Samba 編輯檔案內容
nano /etc/samba/smb.conf
(1)
[global]
workgroup = WORKGROUP
netbios name = MySambaServer
server string = This is samba server
unix charset = utf8
dos charset = cp950
log file = /var/log/samba/%m.log
max log size = 50
security = user
socket options = TCP_NODELAY
SO_RCVBUF=8192
SO_SNDBUF=8192
dns proxy = no
template shell = /bin/false
winbind use default domain = no
(2)尾部加入
下面 = 的右邊 root , 就是smbpasswd新增的帳號名稱
因為在程式開發階段, 習慣用 root登入ubuntu桌面環境
[public]
path = /home/UserXXXX
browseable = yes
guest ok = yes
guest only = yes
read only = no
force user = nobody
force create mode = 0777
force directory mode = 0777
[Home]
path = /home/UserXXXX
writable = yes
guest account = root
force user = root
public = yes
force group = root
read only = no
檢查Samba的設定檔
> testparm
重新啟動 Samba Server
> systemctl restart smbd
將 Unbutu 電腦重新開機, 不重新開機, Windows 端會連線不到,
> reboot
在Windows設定
在網路上的芳鄰圖示下按右鍵,選 "連線網路磁碟機"
沒有留言:
張貼留言