如题所述
Linux和Windows之间文件传输,安装Samba即可(服务器进行网络文件共享的一种方式),然后Windows通过Samba连接,方法如下(以Centos为例):
1、安装Samba相关软件
1
2
3
yum install samba samba-client samba-commo
chkconfig smb on
chkconfig nmb on
2、对路由表做如下操作
1
2
3
4
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、对配置文件进行备份,配置一个公开的目录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
security = share
map to guest = bad user
#===== Share Definitions ==========
[MyShare]
#共享目录路径
path = /home/samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no
4、设置文件夹权限,检测配置文件,重启服务
1
2
3
chmod -R 0777 /home/samba/share
testparm
service smb restart# service nmb restart
5、Windows下以访问共享的方式即可查看共享目录,按下win7的快捷键(WIN+R)打开“运行”工具。
6、在“运行”中输入:\\samba 服务器的ip\共享目录 然后回车即可连接。
1、安装Samba相关软件
1
2
3
yum install samba samba-client samba-commo
chkconfig smb on
chkconfig nmb on
2、对路由表做如下操作
1
2
3
4
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、对配置文件进行备份,配置一个公开的目录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
security = share
map to guest = bad user
#===== Share Definitions ==========
[MyShare]
#共享目录路径
path = /home/samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no
4、设置文件夹权限,检测配置文件,重启服务
1
2
3
chmod -R 0777 /home/samba/share
testparm
service smb restart# service nmb restart
5、Windows下以访问共享的方式即可查看共享目录,按下win7的快捷键(WIN+R)打开“运行”工具。
6、在“运行”中输入:\\samba 服务器的ip\共享目录 然后回车即可连接。
温馨提示:答案为网友推荐,仅供参考
第1个回答 2016-09-24
当然,windows与linux之间文件的传输的两种方式有很多,这里就仅仅列出工作中遇到的,作为笔记;方法一:安装SSH Secure Shell Client客户端
安装即可登录直接拖拉到linux,如果从linux下导出文件则需要如此操作
文件自动回到windows窗口的当前目录;
方法2:通过windows cmd窗口命令
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>d:
D:\>e:
step1:ftp登录本回答被提问者采纳
安装即可登录直接拖拉到linux,如果从linux下导出文件则需要如此操作
文件自动回到windows窗口的当前目录;
方法2:通过windows cmd窗口命令
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>d:
D:\>e:
step1:ftp登录本回答被提问者采纳