Ubuntu14.4下安装FTP
今天学习了Ubuntu上安装ftp的实例。
1.window上已经安装wamp(windows + apache + mysql + php)
2.window上已安装VMware Workstation
3.虚拟机上安装Ubuntu(Linux操作系统)
4.Ubuntu上安装lamp(Linux + apache + mysql + php)
这里Ubuntu作为服务器(Server),windows作为客户端(Client).
演示步骤如下:
第一步:安装vsftpd
打开"终端窗口",输入"sudo apt-get install vsftpd"-->回车-->安装完成。
root@wuheng-virtual-machine:/# sudo apt-get install vsftpd
第二步:判断vsftpd是否安装成功
打开"终端窗口",输入"sudo service vsftpd restart"重启vsftpd服务-->回车-->vsftpd处于运行状态,说明安装成功。
root@wuheng-virtual-machine:/# sudo service vsftpd restart
vsftpd stop/waiting
vsftpd start/running, process 5569
注意:这里“process 5569”,表示vsftpd处于运行状态。
第三步:新建"/home/uftp"目录作为用户主目录
打开"终端窗口",输入"sudo mkdir /home/uftp"-->回车-->输入"sudo ls /home"-->回车-->有一个uftp目录,目录新建成功。
root@wuheng-virtual-machine:/# sudo mkdir /home/uftp
root@wuheng-virtual-machine:/# sudo ls /home
第四步:新建用户uftp并设置密码
打开"终端窗口",输入"sudo useradd -d /home/uftp -s /bin/bash uftp"-->回车-->用户新建成功-->
输入"sudo passwd uftp"设置uftp用户的密码-->回车-->输入两次密码-->回车-->密码设置成功
root@wuheng-virtual-machine:/# sudo useradd -d /home/uftp -s /bin/bash uftp
root@wuheng-virtual-machine:/# sudo passwd uftp
注意:这里要输入2次相同的密码。
第五步:使用gedit修改配置文件/etc/vsftpd.conf
打开"终端窗口",输入"sudo gedit /etc/vsftpd.conf"-->回车-->打开了vsftpd.conf文件,向文件中添加"userlist_deny=NO
userlist_enable=YES userlist_file=/etc/allowed_users"和"seccomp_sandbox=NO"-->使文件中的"local_enable=YES"-->保存。
如:
在vsftpd.conf配置文件下面加入如下配置信息
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/allowed_users
seccomp_sandbox=NO
添加后,保存。注意,可能会保存不成功。报错如:“Could not create a backup file while saving “/etc/vsftpd.conf”
我的解决办法,修改vsftpd.conf配置文件的权限。
-rwxrwxrwx 1 root root 5776 Mar 9 22:55 vsftpd.conf
修改完后,保存。该配置文件的权限应当恢复原状。
第六步:使用gedit新建/etc/allowed_users文件
打开"终端窗口",输入"sudo gedit /etc/allowed_users"-->回车-->输入uftp-->保存, 文件创建成功。
root@wuheng-virtual-machine:/# sudo gedit /etc/allowed_users
utfp
第七步:使用gedit查看/etc/ftpusers文件中的内容
打开"终端窗口",输入"sudo gedit /etc/ftpusers"-->回车-->打开这个文件后,看一看有没有uftp这个用户名,如果没有,就直接退出。
如果有就删除uftp,因为这个文件中记录的是不能访问FTP服务器的用户清单。
root@wuheng-virtual-machine:/# sudo gedit /etc/ftpusers
# /etc/ftpusers: list of users disallowed FTP access. See ftpusers(5).
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
nobody
注意:上面标识红色的,表示这些用户都不能访问FTP服务器,这里没有:uftp用户名,可以直接关掉
第八步:登录FTP服务器
在windows上先安装FlashFXP
a.站点名称,可以自定义。
b.连接类型:ftp
c.地址,也就是服务器的ip地址,这里服务器的ip地址是:192.168.157.128
root@wuheng-virtual-machine:/# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:cd:21:c3
inet addr:192.168.157.128 Bcast:192.168.157.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fecd:21c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2451 errors:0 dropped:0 overruns:0 frame:0
TX packets:2833 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:327202 (327.2 KB) TX bytes:2936304 (2.9 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:230 errors:0 dropped:0 overruns:0 frame:0
TX packets:230 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28208 (28.2 KB) TX bytes:28208 (28.2 KB)
d.端口号:21
e.用户名:uftp (就是我们之前建立的用户,如第三步,第四步)
f.密码:xxxxx (就是我们之前设置的密码,如第四步)
第九步:连接ftp
表示连接成功了。
a.客户端
b.服务器
root@wuheng-virtual-machine:/var/www/html# ls -l
total 20
-rw-r--r-- 1 uftp uftp 0 Mar 9 19:40 a.txt
drwxrwxrwx 3 root root 4096 Mar 9 22:57 demo
-rwxrwxrwx 1 root root 11510 Mar 9 19:21 index.html
lrwxrwxrwx 1 root root 21 Mar 3 18:46 phpmyadmin -> /usr/share/phpmyadmin
-rw-r--r-- 1 root root 249 Mar 9 19:21 wh.tar.gz
root@wuheng-virtual-machine:/var/www/html#
第十步,可能出现的问题与解决方案
a.可能出现本地向ftp上传文件,出现上传不了的情况
解决方案:在vsftpd.conf配置文件中,添加:“write_enable=YES local_umask=022”
write_enable=YES
local_umask=022
这2项表示:可以上传。以确保本地虚拟用户能有读写权限。
参考:http://jingyan.baidu.com/article/67508eb4d6c4fd9ccb1ce470.html
Ubuntu14.4下安装FTP的更多相关文章
- Ubuntu14.0下安装Zend Framework 2
Ubuntu14.0下安装Zend Framework 2为了安装这个东西,忙活了快一天了,参考中文博客一直没有安装成功,有些博客的时间也是已经很早了,后来google看英文版的才安装成功,这里记录一 ...
- Ubuntu14.04下安装Hadoop2.5.1 (单机模式)
本文地址:http://www.cnblogs.com/archimedes/p/hadoop-standalone-mode.html,转载请注明源地址. 欢迎关注我的个人博客:www.wuyudo ...
- 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)
在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...
- Ubuntu14.04下安装Flash Player
Ubuntu14.04下安装Flash Player youhaidong@youhaidong:~$ sudo apt-get install flashplugin-nonfree [sudo] ...
- Ubuntu14.04下 安装p4c
参考: Github p4c README Ubuntu14.04下 安装p4c 这里提供一个直接安装p4c的脚本:install_p4c.sh. 1.git clone下来p4c: $ git cl ...
- Ubuntu14.04下安装Libsvm,并使用Libsvm
(1)Ubuntu14.04下安装Libsvm 转载:https://blog.csdn.net/katrinawj/article/details/78915874 一.下载: 网址:http:// ...
- ubuntu14.04下安装ffmpeg
ubuntu14.04下安装ffmpeg 一.安装各种依赖包 1.yasm(libx264需要依赖yasm) sudo apt-get install yasm 2.libx264 sudo apt- ...
- CentOS7.0下安装FTP服务的方法
http://www.jb51.net/article/106604.htm 本篇文章主要介绍了CentOS7.0下安装FTP服务的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟 ...
- ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录
已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...
随机推荐
- 苹果推送服务器端证书配置.pem生成
做苹果推送服务器,很重要的一步,就是生成与苹果APNS连接的证书,一般是.pem文件: 首先在苹果开发者中心 生成 aps_devlopment.cer文件:然后下载:双击导入钥匙串: 打开钥匙串 - ...
- Python中的__name__
python中if __name__ == '__main__': 的解析 经常会在代码的最下面看到if __name__ == '__main__':,现在就来介 绍一下它的作用. 模块是对象,并且 ...
- webDriver API——第8部分Utilities
The Utils methods. selenium.webdriver.common.utils.free_port() Determines a free port using sockets. ...
- javascript数据结构和算法 第二章 (数组) 二
字符串表示的数组 join() 和 toString() 函数返回数组的字符串表示.这两个函数通过将数组中的元素用逗号分隔符切割,返回字符串数组表示. 这里有个样例: var names = [&qu ...
- JDBC操作,执行数据库更新操作
目标: 使用Connection对象取得Statement实例 使用Statement进行数据增删改. Statement接口 要对数据库操作,要使用Statement完成.此接口可以使用Connec ...
- 阿里云 oss python3 样例
阿里云的oss SDK又是不支持python3,头疼头疼. 本想改一改它的SDK,让它支持python2+python3,无奈里面大量的代码使用不带括号的print.工作量恐怖. 幸好oss的使用很e ...
- 【转】H.264(H264)视频文件的制作
转自:http://blog.csdn.net/caoshangpa/article/details/51166109 一.准备工作 1.下载并安装优酷客户端 2.下载ffmpeg可执行文件,解压可用 ...
- html5-本地数据库的操作
<script src="jquery-1.8.3.js"></script><script>/* IE11不支持此操作创建数据库 解释一下op ...
- socket 통신
00.C# --> Application.ThreadException --> Application.Run --> Container --> Application. ...
- zookeeper(六):Zookeeper客户端Curator的API使用详解
简介 Curator是Netflix公司开源的一套zookeeper客户端框架,解决了很多Zookeeper客户端非常底层的细节开发工作,包括连接重连.反复注册Watcher和NodeExistsEx ...