ubuntu 18.04 – 簡易samba設定 Win10 即可使用帳號登入

提醒, 由於windows會記憶登入設定, 所以如果你發現這次失敗了, 我會建議直接改你ubuntu的ip address 以確保windows為你的samba設置作最新的更新

或是透過指令 net use * /delete 去清除清除已儲存的網路芳鄰密碼

指令介面的設定步驟(ubuntu 16.04)

1. 首先確定自己登入ubuntu的帳號 YOUR_USERNAME, 並以此帳號添加成為samba user,執行:
#sudo smbpasswd -a YOUR_LOGIN_NAME
然後要輸入密碼, 建議設跟登入ubuntu一樣, 才不會忘記

2. 安裝Samba,執行:
#apt-get install samba

3. 檢查版本,執行:
#smbd –version

4. 備份設定檔,執行:
#cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

5. 修改設定檔內容如下:
#vi /etc/samba/smb.conf
基本上完全沒有動到內容, 只是在最後面加入這一段

[shared]
comment = Shared_Files
path = /home/shared
available = yes
guest ok = no
browseable = yes
writable = yes
valid users = YOUR_USERNAME

6. 存檔後,重啟服務:
#sudo service smbd restart

7. 測試Samba的設定是否正確無誤:
# sudo testparm

8. 在位置列或網址列輸入 \\SAMBA_ServerIP

備註:

如果在windows上還是沒法看到samba連線
參考自 windows_10_cant_see_samba_shares
可以去 credential manager (從start那邊輸入搜尋”credential manager”),
進入 windows credentials 並新增你要使用的 server share IP address, 以及 username and password.
If you cannot see the share, just type your server and share address in the windows address field: \server name\share name or \192.168.x.x\share name.

發表迴響