目前我是透過samba讓實體機器Linux 跟VMwave Windows可以互相傳資料
之前samba設定錯誤一直沒有設定權限 這邊記錄一下怎樣設定
install samba on Ubuntu
1
| sudo apt-get install samba
|
create account for samba user
這邊目的是建立一個專屬的可以用samba的account 當然如果懶惰也可以直接用你現有的account 就跳過下一個步驟
create addount : sudo adduser smbuser
新增使用者並同時設定這個使用者的 Samba 登人密碼 : sudo smbpasswd -a smbuser
輸入完密碼之後就可以修改/etc/samba/smb.conf
添加範例如下
1 2 3 4 5 6 7 8 9 10 11 12 13
| [global] security = user #enable security, 設share 就沒有password request [share_file] # share_file 名稱可以自行變更主要是顯示給外面透過search的人看的 path = /home/smbuser # 這個是要分享的資料夾路徑 available = yes valid users = smbuser # 這個是可以使用這個分享資料夾的使用者,要具有 path 所指定的路徑的權限才行 read only = no #public = yes writable = yes browseable = yes # 在透過window 打\\your_IP後支援可以被搜尋到 encrypt passwords = yes # 密碼傳送時要加密 smb passwd file = /etc/samba/smbpasswd #password save path
|
重新啟動 Samba Server
1
| sudo /etc/init.d/samba restart
|
可以透過testparm來檢查設定是否有問題 會顯示如下:
1 2 3 4 5 6 7 8 9
| Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[tmp]" Global parameter encrypt passwords found in service section! Global parameter smb passwd file found in service section! Loaded services file OK. WARNING: 'workgroup' and 'netbios name' must differ. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions
|