Windows訪問Linux可通過搭建samba服務,共享目錄
過程:
Ubuntu安裝sudo apt-get install samba
sudo apt-get install smbfs
sudo apt-get install smbclient
編輯sudo vi /etc/samba/smb.conf
修改處:
# Change this to the workgroup/NT-domain name your Samba server will part of
doc charset = UTF-8
unix charset = UTF-8
workgroup = WORKGROUP
netbios name = user_name.wingtech.com
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user
默認共享的/home/user_name這個文件夾
如果要共享/home/share添加如下:
[share]
comment = this is linux share directory
path = /home/share
browseable = yes
public = yes
writable = yes
注意要將該目錄用戶名和組名改為user_name
sudo chown user_name /home/share
sudo chgrp user_name /home/share
建立賬號sudo smbpasswd -a user_name
重啟下samba服務:sudo service smbd restart
此時可以在windows下訪問/home/user_name和/home/share這兩個文件夾了
可以嘗試net use \\IP * /user:user_name;提示輸入密碼,輸入密碼,提示命令成功完成證明可以共享了。