一.FTP服务端
1.安装FTP
yum install vsftpd
2.启动
1)查询火墙允许的服务:
firewall-cmd --list-all
2)ftp添加火墙允许:
firewall-cmd --permanent --add-service=ftp
systemctl start vsftpd
systemctl enable vsftpd
setenforce 0 selinux强制降低安全级别,这是必须的
3.vsftpd文件信息
/var/ftp/pub 默认文件发布目录
/etc/vsftpd/ 配置文件目录
4.vsftpd配置参数
vim /etc/vsftpd/vsftpd.conf
################# vsftpd.conf 文件内容样例#################
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
1)匿名用户开启:
anonymous_enable=YES
反之则为no
2)匿名用户上传
匿名用户上传时会使用ftp用户,所以:
write_enable=YES
anon_upload_enable=YES
chgrp ftp /var/ftp/pub //组设置为ftp组
chmod 775 /var/ftp/pub
3)匿名用户创建目录:
anon_mkdir_write_enable = YES
4)匿名用户删除文件:
anon_other_write_enable = YES
5)匿名用户下载文件时,幅图片服务器不能读的文件默认不可下载,此时修改:
anon_world_readable_only = NO
6)匿名用户上传限速
anon_max_rate=102400
7)最大在线客户端数
max_clients=1
二.FTP客户端:
1.客户端安装:
yum install lftp
2.远程登陆
lftp xxx.xxx.xxx.xxx
[root@mazha1 pub1]# lftp 192.168.40.20
lftp 192.168.40.20:~> ls
drwxr-xr-x 2 0 0 66 Mar 31 2016 pub
3.get下载
lftp 192.168.40.20:/pub> ls
-rwxrwxr-x 1 0 50 0 Nov 16 14:04 file1
-rwxrwxr-x 1 0 50 0 Nov 16 14:04 file2
-rwxrwxr-x 1 0 50 0 Nov 16 14:04 file3
-rwxrwxr-x 1 0 50 0 Nov 16 14:04 file4
-rwxrwxr-x 1 0 50 0 Nov 16 14:04 file5
lftp 192.168.40.20:/pub> get file1
lftp 192.168.40.20:/pub> exit
[root@mazha1 /]# ls
bin dev file1 lib media mnt opt root sbin sys usr
boot etc home lib64 misc net proc run srv tmp var
三.LDAP 轻量目录访问协议
authconfig --help | less 查询ldap客户端手册