Windows10 下搭建 FTP 服务器
学计算机的人就是喜欢折腾,在学校因为校园网的慢的出翔,时不时系统坏了或者同学之间传点儿稍大的资源因为网速学校断网啥的搞得异常烦躁,U盘传东西又显得捉襟见肘,3.0接口的还买不起,然后就接触到了 FTP (File Transfer Protocol) 这个神奇的东东!Windows下又内置了 IIS (Internet Information Services)只需要把这个功能开启就可以搭建你自己的 FTP 服务器然后。。。。。。就开始吧!
1. 首先 开启服务 win+x 选择 设置 -----> 搜索框中输入 控制面板 后回车 -----> 点击 程序 -----> 选择 启用或关闭Windows功能 -----> 找到 Intenet Information Services -----> 勾选 FTP服务 所有内容以及 Web管理工具 下的 IIS 管理控制台 确定之后会安装该功能





2. 在搜索框中搜索 IIS -----> 左侧树状窗口里 网站 右键 添加ftp站点 -----> 在 ftp站点名称处命个名 物理路径 点击 "..." 图标 找到自己想要分享的文件夹 ----->绑定下 Ip地址都可以选 如果选择 全部未分配 就是用 127.0.0.1 这个 ip(不推荐) 端口号 21 -----> 如果想自动启动就勾选 自动启动ftp站点 -----> SSL 选择 无SSL -----> 身份验证下 勾选 匿名 和 基本 -----> 授权选择 所有用户 -----> 权限 读取 完成





3. 最基本的操作就完成了打开你的 ftp客户端 一般我们就是用平常用的浏览器 在地址栏中输入 ftp:// "你填的ip" 或者 ftp://"你填的ip:21" 再或者 用文件资源管理器打开 win+e 在地址栏输入该地址
注意:如果你是用的全部分配IP地址在本机上访问就是用 ftp://127.0.0.1 其他电脑上就是 ftp://"服务器的IP" 即你电脑的IP 但是再搭建另一个服务器的时候就不要用这个IP了会冲突 用本机IP的服务器会覆盖掉原来的那个服务器其他电脑就访问不了 本机还是通过ftp://127.0.0.1 可以访问成功
查看电脑IP : win+r 输入 cmd 在命令行中输入 ipconfig 查看 ipv4 地址
4.值得注意的是 如果其他电脑访问不了浏览器响应时间超时什么什么的 就要设置 关闭防火墙 或者 允许防火墙通过应用 说一下后者 打开 Windows Defender 安全中心 -----> 防火墙和网络保护 -----> 允许应用通过防火墙 -----> 点击 更改设置 -----> 勾选 Ftp服务器(推荐使用这种方式)





5.其他设置
如果你并不想所有人都可以登录到你的ftp服务器上来就可以设置 授权规则 和 身份验证
匿名登录 :匿名FTP是这样一种机制:用户可通过它连接到远程主机上,并从其下载文件,而无需成为其注册用户。系统管理员建立了一个特殊的用户ID,名为anonymous, Internet上的任何人在任何地方都可使用该用户ID。但是实际上我们不通过专业的客户端软件是不用输入anonymous这个账户名的可以直接就登录进去!
如下几种情况 :
① 只关闭 匿名身份验证 授权规则 仍是 所有用户 登录时就会让你输入 用户名和密码


a.如果你的 Windows 登陆时没有设置密码你就需要先设置密码,然后再登录ftp站点的时候输入你的 账号和密码(你刚刚设置的密码)


b.如果你的 Windows 有密码就输入你的 Windows 登录账号和密码
② 只关闭 基本身份验证 授权规则 不变
直接就可以登陆进去
③两个都关闭的话 。。。。哈哈哈哈哈哈哈隔,那就没什么好说的了
当只是想特定的人登录 就需要更改 授权规则 我们最开始就是直接勾选的 所有用户 现在我们想特定的人才可以登录就需要 删除原来的允许规则 并 添加一个新的规则 下面简单的直接用你的Windows账户登陆,直接上图





当很多人都用的时候就需要新建一些账户给予不同的权限 让他们有不同的权限做不同的工作,
比如:用户ftp1能往服务器上写入数据而用户ftp2就只能下载或者是针对一些文件夹有的人能够看见有的人却不能等等。。。
我们就需要在Windows中新建这些账户来完成设置,怎么设置账户,直接上图吧
*****
不知道怎么回事经过测试千万不要把你的账户命名为 ftp !!!!!!不然登陆不了。。。。
*****
win+x 找到 计算机管理




创建成功后就可直接到 授权规则 里添加新的规则,比如可以增加ftp1往文件里写入的权限


用文件资源管理器可以直接将文件拖入到ftp站点中,所以就直接用的文件资源管理器打开ftp站点




这就是为ftp1用户添加的写权限,如果是另外一个没有写权限的用户来删除文件的话将会提示权限先不够等错误


当站点比较大的时候会有各种各样的目录,会需要不同的用户对不同的目录进行管理,单单的新建用户会使新建规则变得繁琐,这时就可以直接新建组用户对这一类用户进行规则添加操作,方法基本同添加用户方法一样



诸如此,添加你需要足够数量的用户,然后再授权规则里设置

这时就会统一有写入的权限不同的文件夹可以设置不同的权限这里就不一一说了...
最后说一下命令行登录FTP服务器
win+r -----> 输入 cmd 回车 -----> 输入ftp 回车 -----> open "你的ftp站点地址" -----> 填用户名和密码 -----> 成功登录




这里看到进入命令行就是默认 C:\Users\SKY 这个目录下这个会是你从ftp站点上下载文件的默认目录,当然还可以更改后面再说
常见命令如下:
注意:命令与参数之间要有空格
dir (directory) 显示当前目录下的所有文件的详细信息包括时间 名称等信息

ls -al (list)列表命令加上参数后与dir命令差不多

cd (change directory)切换目录的命令
进入ftp站点后 想进入某一个目录就用 cd 目录名称

cd .. 返回到上一层目录
cd \ 直接回到刚进入ftp站点时的默认目录
pwd (print working directory) 打印出当前所在的路径信息

get 文件名 这时从ftp站点下载文件的命令下载的文件的默认目录就是前面所说的 C:\Users\SKY 目录
lcd x:\ 将现在默认的目录切换成某盘根目录

大小写无所谓 还可以在后面添加根目录下的其他路径

这个路径就是你想要文件下载的路径
put 文件名 上传文件命令于下载文件的命令差不多
disconncet 断开连接命令

bye 或者 quit 退出ftp命令


相比之下quit命令是直接 断开连接 并退出 ftp
exit 退出命令行 的命令

常用的命令大概就是这写吧。。。
前面的就是我通过折腾了解到的一些观于ftp服务器方面的东西,这东西类似于文件共享在局域网中,但是要安全一些 命令行登录的时候一分钟左右就会自动断开需要你重新登录这就体现了安全的方面
我也只是了解的一些皮毛,还有很多不足的地方 IIS 还有很多设置都还没去尝试 只是把自己学习到的东西写下来希望能帮助到有需要的人!玩计算机就是要有种折腾的精神在里面最后一句话共勉