55.exportfs commands, NFS client issues, FTP introduction, using VSFTPD to build FTP

Source: Internet
Author: User
Tags file transfer protocol

First, Exportfs command
  • When you need to modify a shared folder or add a shared folder, you can use the EXPORTFS command to reload the configuration without restarting the NFS service, in order to prevent the use of the client from being affected
    Common options
    -A all mount or uninstall all
    -R Re-mount
    -U Uninstalls a directory
    -V Show shared directory
    The following operations are on the service side

    vim /etc/exports //增加/tmp/ 192.168.127.0/24(rw,sync,no_root_squash)然后执行exportfs -arv //不用重启nfs服务,配置文件就会生效


    The following actions are in the client

    mkdir /testmount -t nfs -onolock 192.168.127.128:/tmp /testtouch /test/test.txtls -l !$

    Second, the NFS client problem, the client file belongs to the main genus group nobody

  • The client file belongs to the main genus group nobody
    This issue occurs with NFS version 4
    When a client mounts a shared directory, whether it is a root user or a normal user, a new file is created with the owner and group nobody
  • Method One,
    Add-o nfsvers=3 when client mounts
    Example: Mount-t nfs-o nfsvers=3 192.168.127.128:/tmp/test
  • Method Two,
    Both the client and the server need
    vim/etc/idmapd.conf//
    Change "#Domain = local.domain.edu" to "Domain = xxx.com" (xxx.com here, feel free to define it), and then restart the RPCIDMAPD service or Rpcbind service. FTP Introduction
  • FTP is the abbreviation for the file Transfer Protocol (document Transfer Protocol), which is used to control the two-way transmission of files over the Internet.
  • The primary role of FTP is to have the user connect to a remote computer (which runs an FTP server program), view the files on the remote computer, and then copy the files from the remote computer to the local computer, or transfer the files from the local computer to the remote computer.
  • Small companies with many, large enterprises without FTP, because unsafe

    Iv. using VSFTPD to build FTP service
  • FTP Listening 21 port

  • sshd 22 Port

  • Telnet 23 Port
  • Bring your own vsftpd on CentOS
 yum install -y vsftpd useradd -s /sbin/nologin virftp vim /etc/vsftpd/vsftpd_login //内容如下,奇数行为用户名,偶数行为密码,多个用户就写多行testuser1  //账号1123456     //账号1密码user1       //账号2qwerty      //账号2密码 chmod 600 /etc/vsftpd/vsftpd_login db_load -T -t hash -f /etc/vsftpd/vsftpd_login /etc/vsftpd/vsftpd_login.db    //将密码转换为二进制文件 mkdir /etc/vsftpd/vsftpd_user_conf  cd /etc/vsftpd/vsftpd_user_conf

    • The profile name is the same as the user name in the user password file
      vim testuser1 //加入如下内容local_root=/home/virftp/testuser1  //指定虚拟用户的家目录anonymous_enable=NO    //是否允许匿名用户write_enable=YES       //是否允许可写local_umask=022        //创建文件或目录的默认权限anon_upload_enable=NO   //是否允许匿名用户上传anon_mkdir_write_enable=NO   //是否允许匿名用户创建文件夹,写文件idle_session_timeout=600      //连接ftp之后空闲多久字段断开data_connection_timeout=120   //数据传输超时时间max_clients=10                    //最大客户端数
      mkdir /home/virftp/testuser1touch /home/virftp/testuser1/test.txtchown -R virftp:virftp /home/virftpvim /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

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=virftp   //虚拟用户映射到virftp 用户virtual_use_local_privs=YES   //告诉服务需要用虚拟用户登陆ftpuser_config_dir=/etc/vsftpd/vsftpd_user_conf   //虚拟用户配置文件目录allow_writeable_chroot=YES
 systemctl start vsftpd //启动vsftpd服务

    • Test FTP
      Yum Install-y lftp
      lftp [email protected]
      Execute command LS to see if normal output
      viewing logs/var/log/messages and/var/log/secure if not normal
      Install FileZilla client software under Windows and test

55.exportfs commands, NFS client issues, FTP introduction, using VSFTPD to build FTP

Related Article

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.