Linux和Windows之間文件傳輸,安裝Samba即可(服務器e68a84e8a2ade799bee5baa631333337613165進行網絡文件共享的一種方式),然后Windows通過Samba連接,方法如下(以Centos為例):
1、安裝Samba相關軟件
yum install samba samba-client samba-commo
chkconfig smb on
chkconfig nmb on
2、對路由表做如下操作
iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
service iptables save
3、對配置文件進行備份,配置一個公開的目錄
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
rm /etc/samba/smb.conf
touch /etc/samba/smb.conf
vi /etc/samba/smb.conf
#配置一個公開的訪問目錄,在新創建的smb.conf文件中加入以下配置
<pre name="code" class="plain">
#========= Global Settings ========
[global]
workgroup = WORKGROUP
map to guest = bad user
#===== Share Definitions ==========
[MyShare]
#共享目錄路徑
path = /home/samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no
4、設置文件夾權限,檢測配置文件,重啟服務
chmod -R 0777 /home/samba/share
testparm
service smb restart# service nmb restart
5、Windows下以訪問共享的方式即可查看共享目錄,按下win7的快捷鍵(WIN+R)打開“運行”工具。
6、在“運行”中輸入:\\samba 服務器的ip\共享目錄 然后回車即可連接。