Major file Services Vsftp, Samba, NFS
Contrast:
File Share (Network Places)
server name |
User Client platform |
Use range |
Service port |
ftp |
windows/ Linux/unix/macos |
Publishing site, file sharing |
Tcp/21 |
Samba |
windows |
tcp/445,tcp/139 |
|
linux/unix |
Web Publishing, file Sharing (Mount) |
tcp/2049 |
First, FTP construction:
1. Build FTP service with vsftpd :
Introduction :
Security is the original intention of writing vsftp, in addition to the inherent safety features, high speed and high stability is also two important characteristics of vsftp.
is Sentos or Redhat on the FTP software, not installed by default, generally perform Yum installation
installation :
Check whether to install vsftp package # rpm–QA | grep vsftpd
Yum install-y vsftpd db4-utils//Here Db4-utils used to generate the password file
Create an account :
VSFTP Support System account login, for security reasons we use virtual account login
#useradd-virftp-s/sbin/nologin
To create a configuration file for a virtual account:
#vim/etc/vsftpd/vsftpd_login
test1 123456 Test2abcdef
#该文件存储用户和密码, odd-numbered user name, even-numbered behavior password
Set permissions for security reasons
#chmod 600/etc/vsftpd/vsftpd_login
The password used by VSFTPD is not clear text and now generates the corresponding library file using the user & password file:
#db_load-T-t hash-f/etc/vsftpd/vsftpd_login/etc/vsftpd/vsftpd_login.db
Finally, create the directory and configuration file associated with the virtual account as follows:
#mkdir/etc/vsftpd/user_conf//This path is consistent with the User Configuration directory settings in the global configuration file
Create and user-corresponding profiles
Each user has a corresponding profile, file name and user name that have been used to customize the user Configuration
Switch to the user_conf created above
#vim test1
local_root=/home/virftp/Test1
Anonymous_enable=nowrite_enable=yeslocal_umask=022anon_upload_enable= noanon_mkdir_write_enable=noidle_session_timeout=data_connection_timeout =max_clients=tenmax_per_ip=5local_max_rate =50000
The meaning of each parameter should not be difficult to understand according to the literal meaning
#mkdir/home/virftp/test1; Touch Test.txt
#chown-R virftp.virftp/home/virftp
#vim/etc/pam.d/vsftpd//Add at the beginning
Auth sufficient/lib64/security/pam_userdb.so db=/etc/vsftpd//lib64/security/pam_userdb.so db=/etc/vsftpd /vsftpd_login
CentOS is 64-bit, so the library file path is/lib64/security/pam_userdb.so (32-bit for/lib/security/pam_userdb.so)
To Modify the global configuration file/etc/vsftpd/vsftpd.conf
In addition to modifying our user profiles, we also need to modify some of the global configuration files
Vim/etc/vsftpd/vsftpd.conf
Modify
anonymous_enable=noanon_upload_enable=noanon_mkdir_write_enable=no
Increase
chroot_local_user=yesguest_enable=yesguest_username=virftpvirtual_use_local_privs=YESuser_ config_dir=/etc/vsftpd/user_confallow_writeable_chroot=yes
Start:
#service vsftpd Start
Test: Install client fear Lftp
#yum Install Lftp
#lftp [email protected]
Password:
lftp [email protected]:~> ls
-rw-r--r--1 503 504 Dec 13:37 text.txt
File services on Linux