分类: LINUX
2015-04-29 22:30:14
简介:
FTP是常用的传输工具。要学会快速的搭建FTP服务器!
安装FTP服务器端
1.安装FTP,并设置开机启动:
yum install vsftpd -y
touch /var/log/vsftp.log
chkconfig vsftpd on
service vsftpd start
|
2.设置配置文件
vim /etc/vsftpd/vsftpd.conf
listen=YES
background=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
file_open_mode=0777
local_umask=000
anon_upload_enable=NO
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_max_rate=0
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=NO
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to mreald FTP servers
pam_service_name=vsftpd
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
local_root=/var/ftp_dir
|
3.增加可以登陆的用户
$useradd -g ftp -d /var/ftp_dir -s /sbin/nologin webftp
$passwd webftp
vim /etc/vsftpd/user_list
webftp
|
4.权限设置
$mkdir /var/ftp_dir
$chown webftp /var/ftp_dir
$chmod 755 /var/ftp_dir
|
远程FTP登陆:
root@blog-mreald-com:~/Downloads# ftp 192.17.226.12
Connected to 192.17.226.12.
220 Welcome to mreald FTP servers
Name (1IP:root): webftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
|
问题:
vsftp打开运行之后 ,还是连不上 1.防火墙 2.ftp没安 yum install ftp 3.目录权限不对