Exportfs command
The EXPORTFS command can add a shared directory without restarting the NFS service.
Test: First change the server-side NFS configuration file
[[email protected] ~]# vim /etc/exports ##增加以下内容
/tmp 192.168.63.101(rw,sync,no_root_squash) ##共享给192.168.63.101这个ip
Executive Exportfs-arv
[[email protected] ~]# exportfs -arv
Mount on client
[[email protected] ~]# mount -t nfs 192.168.63.100:/tmp/ /mnt/
Client builds a file under MNT
[[email protected] ~]# vim /mnt/han.txt
NFS Client Issues
Introduction to FTP
Using VSFTPD to build an FTP service
Installing VSFTPD
[[email protected] ~]# yum install -y vsftpd
Creating an ordinary user is created to allow these virtual users to do a mapping
[[email protected] ~]# useradd -s /sbin/nologin virftp ##virftp这个名字可以随意写
Edit the virtual user's password file, in which you need to define a user name and password
[[email protected] ~]# vim /etc/vsftpd/vsftpd_login
Settings for permissions
[[email protected] ~]# chmod 600 /etc/vsftpd/vsftpd_login
Convert a text password file into a computer-recognized binary file
[[email protected] ~]# db_load -T -t hash -f /etc/vsftpd/vsftpd_login /etc/vsftpd/vsftpd_login.db
Create virtual users in the same directory as their configuration files. This directory is also custom-defined
[[email protected] ~]# mkdir /etc/vsftpd/vsftpd_user_conf
Enter into the/etc/vsftpd/vsftpd_user_conf directory. Create a profile for the first user, the profile name of the user he needs to be consistent with the user's name
[[email protected] vsftpd_user_conf]# vim testuser1
local_root=/home/virftp/testuser1anonymous_enable=NOwrite_enable=YESlocal_umask=022anon_upload_enable=NOanon_mkdir_write_enable=NOidle_session_timeout=600data_connection_timeout=120max_clients=10
After you define a virtual user, create a user's home directory
[[email protected] vsftpd_user_conf]# mkdir /home/virftp/testuser1
When you create a file
[[email protected] vsftpd_user_conf]# touch /home/virftp/testuser1/hanshuo.txt
Permissions modification
[[email protected] vsftpd_user_conf]# chown -R virftp:virftp /home/virftp
Defining where a password file is important
[[email protected] vsftpd_user_conf]# vim /etc/pam.d/vsftpd ##这是用来认证的一个文件
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_loginaccount sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
Edit the VSFTPD Master profile
[[email protected] vsftpd_user_conf]# vim /etc/vsftpd/vsftpd.conf
将anonymous_enable=YES 改为 anonymous_enable=NO ##不允许匿名用户 将#anon_upload_enable=YES 改为 anon_upload_enable=NO 将#anon_mkdir_write_enable=YES 改为 anon_mkdir_write_enable=NO ##不允许创建用户 再增加如下内容chroot_local_user=YESguest_enable=YESguest_username=virftpvirtual_use_local_privs=YESuser_config_dir=/etc/vsftpd/vsftpd_user_confallow_writeable_chroot=YES
Start
[[email protected] vsftpd]# systemctl start vsftpd
Test FTP
First install the FTP software on the client (FileZilla software) This is the FTP open source free, can build services, and he also has a client software very useful
* * Do the test simply install a Linux FTP client software directly, download
[[email protected] ~]# yum install -y lftp
LFTP usage
[[email protected] vsftpd_user_conf]# lftp [email protected]
口令: ##输入test1的密码lftp [email protected]:~> ls -rw-r--r-- 1 1000 1000 0 Aug 28 15:07 hanshuo1.txt
Get download
lftp [email protected]:/> get hanshuo1.txt
lftp [email protected]:/> exit [[email protected] vsftpd_user_conf]# lshanshuo1.txt test1
Windows test needs to download FileZilla client
XSHLL implementation of FTP similar functions two scenarios
First new session
Xshell Transferring files using xftp
The second method uses xftp this need to install plug-ins, you can use shortcut keys Ctrl+alt+f
Click to download Xftp
Install the downloaded XFTP
* * After the installation is complete, enter XSHLL session, in the shortcut key ctrl+alt+f
Using PURE-FTPD to build an FTP service
This pure-ftpd is more simple to use
Installing PRUE-FTPD
[[email protected] ~]# yum install -y epel-release[[email protected] ~]# yum install -y pure-ftpd
After you install the change configuration file
[[email protected] ~]# vim /etc/pure-ftpd/pure-ftpd.conf
If you have previously configured VSFTPD, please turn it off.
[[email protected] ~]# systemctl stop vsftpd ##关掉vsftpd
Start PURE-FTPD
[[email protected] ~]# systemctl start pure-ftpd
Create a Test Catalog
[[email protected] /]# mkdir /home/ftp ##用来给pure-ftpd的用户使用
Create a normal user
[[email protected] ~]# useradd -u 1020 ftpd
change the genus/home/ftp to ftpD
[[email protected] ~]# chown -R ftpd:ftpd /home/ftp
Create a user with PURE-PW Useradd, create this user first specify the user name Ftp_usera, with-u this option to specify the user ftpd of your system, and then the user's home directory
[[email protected] ~]# pure-pw useradd ftp_usera -u ftpd -d /home/ftp
Password: ##设置他的密码输入两遍Enter it again:
Generate password
[[email protected] ~]# pure-pw mkdb
Test
Let's build a file on the/home/ftp.
Xshell using XFTP to transfer files, using PURE-FTPD to build an FTP service