Linux vsftp
本机环境CentOS-6.6-i386-bin-DVD1.iso安装盘、安装时选择minimal模式。本机IP地址配置为192.168.0.211。
1、查询系统是否已安装了vsftpd
[root@localhost ~]# rpm -qa | grep vsftpd
[root@localhost ~]#
通过yum命令安装vsftpd软件
[root@localhost ~]# yum install -y vsftpd
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.yun-idc.com
* updates: mirrors.neusoft.edu.cn
解决依赖关系
--> 执行事务检查
---> Package vsftpd.i686 0:2.2.2-13.el6_6.1 will be 安装
--> 完成依赖关系计算 依赖关系解决 ================================================================================
软件包 架构 版本 仓库 大小
================================================================================
正在安装:
vsftpd i686 2.2.2-13.el6_6.1 updates 157 k 事务概要
================================================================================
Install 1 Package(s) 总下载量:157 k
Installed size: 344 k
下载软件包:
vsftpd-2.2.2-13.el6_6.1.i686.rpm | 157 kB 00:11
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-6.el6.centos.12.2.i686 (@anaconda-CentOS-201410241409.i386/6.6)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : vsftpd-2.2.2-13.el6_6.1.i686 1/1
Verifying : vsftpd-2.2.2-13.el6_6.1.i686 1/1 已安装:
vsftpd.i686 0:2.2.2-13.el6_6.1 完毕!
查看是否安装成功
[root@localhost ~]# rpm -qa | grep vsftp
vsftpd-2.2.2-13.el6_6.1.i686
[root@localhost ~]#
证明安装成功,启动服务。
[root@localhost ~]# service vsftpd restart
关闭 vsftpd: [失败]
为 vsftpd 启动 vsftpd: [确定]
2、vsftpd配置
vsftpd默认配置是已经打开匿名服务访问的。操作如下:
D:\>ftp
ftp> open 192.168.0.211 (linux主机的IP地址)
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): anonymous
331 Please specify the password.
密码:
230 Login successful.
ftp>
如何禁用匿名登录
[root@localhost/]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
修改配置前先备份原配置文件 将anonymous_enable=YES 设置为NO
[root@localhost/]# vi /etc/vsftpd/vsftpd.conf
12 annonymous_enable=NO
[root@localhost/]# service vsftpd restart 重启服务
测试
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): anonymous
331 Please specify the password.
密码:
530 Login incorrect.
登录失败。
ftp>
登录失败,证明禁用匿名登录配置成功。
创建一个系统用户来登录FTP
[root@localhost/]# useradd -s /sbin/nologin fftp
默认新增加的用户还不能登录,需要修改一下密码。
[root@localhost/]# passwd fftp 修改密码
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): fftp
331 Please specify the password.
密码:
230 Login successful.
登录成功,新建的系统用户直接就可以登录ftp。默认这些系统用户是没有设置锁定在自己家目录的。测试如下。
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x 3 513 513 4096 Apr 13 14:29 Desktop
226 Directory send OK.
ftp: 收到 65 字节,用时 0.00秒 65000.00千字节/秒。
ftp> cd ..
250 Directory successfully changed.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwx------ 5 513 513 4096 Apr 13 14:29 fftp
drwx------ 2 511 90 4096 Apr 12 14:04 hacluster
drwx------ 6 512 512 4096 Apr 13 13:49 llk
226 Directory send OK.
ftp: 收到 190 字节,用时 0.00秒 190.00千字节/秒。
ftp>
可以看到系统用户默认是没有锁定在自己家目录的。那这样不安全。需要配置锁定目录。
[root@localhost/]# vi /etc/vsftpd/vsftpd.conf 去掉前面#号
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list 限制更多系统用户 然后把所有用户加入/etc/vsftpd/chroot_list 即可 [root@localhost/]# ls /etc/vsftpd/chroot_list 默认chroot_list文件是不存在的,需要我们手动建立
ftpusers user_list vsftpd.conf vsftpd.conf.bak vsftpd_conf_migrate.sh [root@localhost/]# touch /etc/vsftpd/chroot_list
[root@localhost/]# cut -d : -f 1 /etc/passwd>>/etc/vsftpd/chroot_list 把本地用户全加入到这个限制文件中
[root@localhost/]# service vsftpd restart 重启服务
测试
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): fftp
331 Please specify the password.
密码:
230 Login successful.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x 3 513 513 4096 Apr 13 14:29 Desktop
226 Directory send OK.
ftp: 收到 65 字节,用时 0.00秒 65000.00千字节/秒。
ftp> cd ..
250 Directory successfully changed.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x 3 513 513 4096 Apr 13 14:29 Desktop
226 Directory send OK.
ftp: 收到 65 字节,用时 0.00秒 65.00千字节/秒。
ftp>
经测试发现用户已经被锁定在自己家目录里了。
系统添加一个用户默认有ftp的登录权限,是不安全的。要一个个设置,有点繁琐。利用ftp用户策略解决这个问题。即user_list文件设置,只有user_list中存在的用户才能登录系统。
[root@localhost/]# vi /etc/vsftpd/vsftpd.conf
在userlist_enable=YES文件后面添加
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list [root@localhost/]# service vsftpd restart 重启服务
测试
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): fftp
530 Permission denied.
登录失败。
ftp>
操作证明配置正确。因为用户fftp没有加入至user_list文件中。所以登录失败。
[root@localhost/]# vi /etc/vsftpd/user_list 将用户加至文件最后一行 [root@localhost/]# service vsftpd restart 重启服务
测试
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): fftp
331 Please specify the password.
密码:
230 Login successful.
ftp>
登录成功。
有时也想限制一用户不能登录ftp
[root@localhost/]# cat /etc/vsftpd/ftpusers 查看限制用户
可以将限制用户加入。用fftp用户测试。
[root@localhost/]# vi /etc/vsftpd/ftpusers 将fftp用户加入文件最后一行 [root@localhost/]# service vsftpd restart 重启服务
测试
D:\>ftp
ftp> open 192.168.0.211
连接到 192.168.0.211。
220 (vsFTPd 2.0.5)
用户(192.168.0.211:(none)): fftp
331 Please specify the password.
密码:
530 Login incorrect.
登录失败。
ftp>
登录失败。证明限制用户已起作用。
Linux vsftp的更多相关文章
- Linux VSFTP服务器详细配置
Linux VSFTP服务器 1.开启服务 [root@localhost root]# service vsftpd start Starting vsftpd for vsftpd: ...
- Linux VSFTP服务器
Linux VSFTP服务器 一.Linux FTP服务器分类: <1>wu-ftp <2>proftp=profession ftp <3>vsftp=very ...
- linux vsftp查看ftp账号信息的方法
linux vsftp查看ftp账号信息的方法 查看注册的FTP账号 在/etc/vsftpd/chroot_list 密码看不到 只能重置密码 passwd username
- LINUX VSFTP配置及安装
------------------转载:亲身实践,确实好用(http://www.cnblogs.com/jack-Star/p/4089547.html) 1.VSFTP简介 VSFTP是一个基于 ...
- linux vsftp配置
1.rpm -q ftp 查看是否安装ftp服务器 2.yum install vsftp 安装ftp服务器 3.修改配置文件/etc/vsftpd 下面的 ftpusers和user_list,这两 ...
- Linux vsftp配置本地用户
主要讲的是配置本地用户, ftp现在用的也少了,一般都用ssh和svn 1. 安装ftp yum -y install vsftpd 2. 配置 /etc/vsftpd/vsftpd.conf # ...
- linux vsftp 简单配置
查看自己是否安装vsftp rpm -qa | grep vsftp rpm -qa 查看自己已安装的包 过滤vsftp systemctl rsetart vsftpd 重启服务 先关闭防火墙 sy ...
- 服务器&linux
linux vsftp查看端口占用:netstat -natp |grep 21如果有占用21端口进程,kill它 ,或者remove它.安装:yum -y install vsftpduseradd ...
- linux学习笔记汇总
linux 文件系统是采用级层树状的目录结构,采用"/"根目录的方式 目录结构: / 根目录 |---root: 存放root用户相关的文件 ...
随机推荐
- Junit。。。
keep the bar green to keep the code clean.
- Socket.io:有点意思
个人网站 欢迎品尝 edwardesire.com 下面页面就是使用Socket.io制作的口袋妖怪游戏(默认小屏下已隐藏,请切换到大分辨率查看).左边是游戏画面,右边是按键表和聊天室.画面达到红蓝版 ...
- mysqldump造成Buffer Pool污染的研究
前言: 最近Oracle MySQL在其官方Blog上贴出了 5.6中一些变量默认值的修改.其中innodb_old_blocks_time 的默认值从0替换成了1000(即1s) 关于该参数的作用摘 ...
- hdu 5640 King's Cake(BestCoder Round #75)
King's Cake Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- 转载 JQuery.data()方法学习
转载原地址 http://hanchaohan.blog.51cto.com/2996417/1271551 转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.ht ...
- exit和_exit的区别
参考 http://www.cnblogs.com/hnrainll/archive/2011/08/17/2142001.html p.p1 { margin: 0.0px 0.0px 0.0px ...
- Windows 下如何设置 只允许固定IP远程访问
通过设置IP安全策略限制固定IP访问 说明: (1)以XP环境为例,步骤:先禁止所有IP,再允许固定IP访问. (2)配置过程中很多步骤图是重复的,一些没价值的图就省略了: (3)光看的话可能中间重复 ...
- SQL SERVER 2008/2012/2012R2/2014 设置开启远程连接(sa配置)
本文方案适用于Microsoft Sql Server 2008/2012/2012 r2/2014版本,以下简称MSSQLSERVER. MSSQL默认是不允许远程连接,并且禁用sa账户的.如果想要 ...
- C# 添加类库依赖
- hdu 5278 Geometric Progression 高精度
Geometric Progression Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://bestcoder.hdu.edu.cn/contes ...