Linux服务器配置---安装vsftpd

简介:
安装vsftpd
大多数Linux系统都使用vsftpd,因此这里我们也安装vsftpd
1、安装vsftpd 
      [root@localhost phpMyAdmin]#  yum install -y vsftpd
      Loaded plugins: fastestmirror, refresh-packagekit, security
      Installed:
        vsftpd.i686 0:2.2.2-11.el6_4.1                                                      
      Complete!
      [root@localhost phpMyAdmin]# 

2、设置防火墙,vsftpd默认使用21端口,因此必须在防火墙中设置允许访问21端口 
      1)在终端输入命令“setup”,在弹出的框中选择“防火墙”,接着选择“定制”
      
      2)使用空格键选中”ftp”,接着选择“转发”
      
      3)选择“添加“
      
      4)添加端口21,协议tcp,然后确定
      
      5)回到最初的界面,“确定”
      
      6)重启防火墙
      [root@localhost phpMyAdmin]#  service iptables restart
      iptables:将链设置为政策 ACCEPT:filter nat                [确定]
      iptables:清除防火墙规则:                                 [确定]
      iptables:正在卸载模块:                                   [确定]
      iptables:应用防火墙规则:                                 [确定]
      iptables:载入额外模块:nf_conntrack_ftp                   [确定]
      [root@localhost phpMyAdmin]# 

3、启动vsftpd
      [root@localhost bin]#  service vsftpd start
      为 vsftpd 启动 vsftpd:                                    [确定]

4、测试
1)安装lftp
      [root@localhost phpMyAdmin]#  yum install -y lftp
      Installed:
        lftp.i686 0:0.17-54.el6                                                              
      Complete!
2)连接ftp
      [root@localhost bin]#  lftp 192.168.0.113
      lftp 192.168.0.113:~> ls
      drwxr-xr-x    2 0        0            4096 Mar 01  2013 pub
      lftp 192.168.0.113:/> cd pub
      lftp 192.168.0.113:/pub> ls
      lftp 192.168.0.113:/pub> 

5、修改端口。ftp默认端口是21,但是很多时候都会改变端口,这是就需要修改配置文件“/etc/vsftpd/vsftpd.conf”,在结尾追加一句”listen_port=8765”。
      [root@localhost pub]#  gedit /etc/vsftpd/vsftpd.conf  
      listen_port=8765

6、重启服务测试。请先按照第二步修改防火墙配置
      [root@localhost ~]#  service vsftpd restart
      关闭 vsftpd:                                              [确定]
      为 vsftpd 启动 vsftpd:                                    [确定]

      [root@localhost ~]#  lftp 192.168.0.113      //按照默认的端口来连接
      lftp 192.168.0.113:~>  ls                      //使用ls命令,发现根本没有连接上
      中断                                     
      lftp 192.168.0.113:~> 

      [root@localhost ~]#  lftp 192.168.0.113:8765        //连接的时候指定端口号
      lftp 192.168.0.113:~> ls                              //使用ls命令可以查看内容,说明连接成功
      drwxr-xr-x    2 0        0            4096 Aug 14 03:38 pub
相关文章
|
10天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
61 0
|
10天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
28 0
|
10天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
15 0
|
10天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
35 0
|
10天前
|
Java Linux
Springboot 解决linux服务器下获取不到项目Resources下资源
Springboot 解决linux服务器下获取不到项目Resources下资源
|
13天前
|
Linux
linux下搭建tftp服务器教程
在Linux中搭建TFTP服务器,需安装`tftp-server`(如`tftpd-hpa`)。步骤包括:更新软件包列表,安装`tftpd-hpa`,启动并设置开机自启,配置服务器(编辑`/etc/default/tftpd-hpa`),添加选项,然后重启服务。完成后,可用`tftp`命令进行文件传输。例如,从IP`192.168.1.100`下载`file.txt`: ``` tftp 192.168.1.100 <<EOF binary put file.txt quit EOF ```
28 4
|
3天前
|
关系型数据库 MySQL Linux
Linux联网安装MySQL Server
Linux联网安装MySQL Server
13 0
|
6天前
|
Linux 数据安全/隐私保护
Linux基础与服务器架构综合小实践
【4月更文挑战第9天】Linux基础与服务器架构综合小实践
1192 6
|
10天前
|
Java Linux 开发工具
linux jdk的安装
linux jdk的安装
16 0
|
18天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器