您好,欢迎访问这里是深圳市硕远科技有限公司!
戴尔服务器价格_IBM联想配置_浪潮代理-深圳市硕远科技有限公司
联系我们
戴尔服务器价格_IBM联想配置_浪潮代理-深圳市硕远科技有限公司
邮箱:2324898850@qq.com
电话:400-080-6079
地址:深圳市龙华区河背工业区108创业园A301
当前位置:主页 > 新闻动态 > 企业新闻 >

企业新闻

Windows下ftp服务配置和管理

发布时间:2022-05-12 22:03:09浏览次数:

ftp在linux下实现

0、设置虚拟机通信模式为仅主机模式,和宿主机vmnet1通信,配置服务器IP地址和宿主机vmnet1地址保证在同一网络中。

#su - root
#vim   /etc/sysconfig/network-scripts/ifcfg-xxx
BOOTPROTO=static                    修改获得IP地址方式为static手工配置
ONBOOT=yes                          修改值为yes激活网卡
IPADDR=192.168.215.1xx             设置IP
NETMASK=255.255.255.0             设置子网掩码
GATEWAY=192.168.215.254           设置网关
DNS1=114.114.114.114                设置DNS服务器地址
#systemctl restart network
#ifconfig 或 ip a    
#ping  宿主机IP                           保证ping通

1、安装vsftpd服务软件

1)先进行yum安装源配置

#mount  /dev/cdrom  /mnt   每次开机重新执行
#cd  /etc/yum.repos.d/
#ls
#rm -rf  *
#vim 1.repo
[cdrom]
name=cdrom
baseurl=file:///mnt
enabled=1
gpgcheck=0
#yum list   
#yum repolist

2)安装ftp服务软件

[root@geweilun ~]#yum -y install vsftpd
[root@geweilun ~]#rpm -q vsftpd


2、主配置文件路径:

[root@geweilun vsftpd]# vim /etc/vsftpd/vsftpd.conf   
 

思考:从哪些方面配置FTP服务:

1)主目录设置及添加资源到主目录

2)站点地址:给ftp站点分配IP地址,默认端口号21?端口号的含义:表示一个进程。

3)对用户进行身份验证:

匿名ftp访问:只能以anonymous或ftp用户名登陆,密码为guest

用户ftp访问:必须以用户名和口令来登录服务器

混合访问:匿名或以特定用户来访问

4)用户访问ftp站点目录下资源的权限设置:读取、写入

匿名访问权限:一般读取

特定用户访问权限:赋予写入权限

3、设置服务器监听的ip地址和端口,此配置语句可省略,因为端口默认21,监听ip地址默认为服务器地址。

listen_address=192.168.215.xxx
listen_port=21

匿名访问ftp服务配置:

1、匿名用户访问ftp服务器,匿名访问用户名为 ftp或anonymous,密码为guest, 匿名用户访问主目录默认为/var/ftp/。在此主目录下建立文件作为下载资源:

[root@geweilun ~]#cd  /var/ftp
[root@geweilun ~]#touch  1.txt
[root@geweilun ~]#mkdir test; touch test/f1

验证:

1)用下列命令启动和重启ftp服务

[root@geweilun ~]#sytemctl  start  vsftpd      启动
[root@geweilun ~]# sytemctl  restart  vsftpd     重启
[root@geweilun ~]# sytemctl  status  vsftpd     查看状态
 

2)在客户端匿名访问ftp站点:

ftp://192.168.251.xxx
ftp://anonymous@192.168.251.xxx
 ftp://ftp:guest@192.168.251.xxx


如果访问不了,关闭防火墙

[root@geweilun ~]# getenforce        enforce防火墙状态
Enforcing
[root@geweilun ~]#setenforce 0          设置为允许访问
[root@gewei# getenforce
     permissive
Permissivelun ~]# systemctl status firewalld    firewalld防火墙
[root@geweilun ~]# systemctl stop firewalld
 

2. 改变匿名用户访问的主目录为自己指定的主目录:

  [root@geweilun ~]#mkdir  /opt/ftp        //建立指定主目录
     [root@geweilun ~]#touch  /opt/ftp/1.doc     //建立文件
[root@geweilun ~]#mkdir  /opt/ftp/home     //建立目录

3.打开配置文件/etc/vsftpd/vsftpd.conf,在配置文件中通过anon_root属性指定匿名用户访问主目录:

    anon_root=/opt/ftp           //添加配置语句 
400-080-6079