54 Lessons (EXPORTFS commands, NFS client issues, FTP introduction, using VSFTPD to build FTP)

Source: Internet
Author: User

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    

Create a user

[[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

54 Lessons (EXPORTFS commands, NFS client issues, FTP introductions, using VSFTPD to build FTP)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.