Windows与Linux文件共享

Windows与Linux文件共享

Samba服务器

  1. 安装Samba服务器

rpm –ivh /mnt/Packages/Samba-3.5.10-125.el6.i686.rpm

  1. 添加用户并修改密码

useradd win

passwd ******

  1. 设置该用户登录Samba服务器的密码

smbpaaawd –a win

  1. 配置Samba服务

vim /etc/samba/smb.conf

修改内容:

复制homes内容

改名添加[root]

[root]

comment = Root Directories

path = /

browseable =yes

writeable =yes

valid users =win

配置好以上步骤后,在电脑的浏览器中输入:

\\192.168.1.102根据linux的IP地址来输入,进去后输入用户名就是刚建立的win,密码******,打开root目录,进入后不能打开win目录是因为selinux没有关闭。所以我们还需要关闭selinux,命令:setenforce permissive

WinSCP应用

  1. 前提,从Windows能够ping通linux
  2. 关闭Linux防火墙

运行命令:/etc/init.d/iptables stop

  1. 打开软件WinSCP

设置好选择SFTP、输入IP、用户名、密码

TFTP与NFS服务器配置

TFTP服务器

  1. 安装TFTP服务器

rpm –ivh /mnt/Packages/tftp-server-0.49-7.el6.i686.rpm

  1. 配置tftp服务器

vim /etc/xinetd.d/tftp

设置共享目录在哪

server_arg = -S /home(下载文件所放目录)

disable = no

  1. 重启tftp服务

/etc/init.d/xinetd restart

  1. 测试tftp服务

在Windows下用tftpd32软件测试

  1. 看是否启动了tftp

命令:netstat –a|grep tftp

NFS 服务器

  1. 配置NFS服务器

vim /etc/exports

添加:如下一行

/tmp *(rw, sync, no_root_squash)

/tmp:共享目录

*:允许访问共享目录的主机IP             192.168.1.* *:表示所有IP

(rw,sync,no_root_squash):访问权限

  1. 启动NFS服务器

/etc/init.d/nfs restart

上一篇:C++如何解析函数调用


下一篇:virtualbox 下windows与虚拟机实现文件共享---挂载