Exportfs commands, NFS room-side issues, FTP

Source: Internet
Author: User
Tags file transfer protocol

First, Exportfs command

Use:

NFS cannot be restarted randomly, which causes the client process to be abnormal, only to have the client cancel the NFS shared directory first.
But Exportfs can be on the server
-A all mount or uninstall all
-R Re-mount
-U Uninstalls a directory
-V Show shared directory
Execution Exportfs-arv After we have modified the configuration file on the server, it will take effect without shutting down the NFS service
Cases:
We add a line of configuration on the Exportts configuration file on the server
VI/
/TMP/192.168.1.12/24 (Rw,sync,no_root_squash)
Then use the EXPORTFS-ARV command to reload the configuration file.

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

1. It will be encountered on CENOS6 and will have this problem in NFS version 4.
After the room mount shared directory, whether it is the root user or the ordinary user, the creation of the new file is the main, belong to the group of nobody
2. Solution:
2.1 Client mount as 3 version:-O nfsvers=3
Example: Mount-t nfs-o nfsvers=3 192.168.1.12:/tmp//mnt/

2.2 Service and room-side are required
Editor: vim/etc/idmapd.conf
Change "#Domain =local.domain.edu" to "Domain = xxx.com" (xxx.com) and restart the Rpcbind service.

Iii. Introduction of FTP

1?FTP is an abbreviation for File Transfer Protocol, which is used to control the two-way transmission of files over the Internet.
The main function of 2?FTP is to allow users to connect to a remote computer. and view the files on the remote computer, and then copy the files from the remote computer to the local computer, or upload the local files to the remote computer.
3. Small companies use many, large companies without FTP, because unsafe, generally they use the automated publishing platform.

Iv. using VSFTPD to build FTP service

1?cenos on the VSFTPD,
Install it with Yum: Yum install-y vsftpd
2, create a normal user, (for the security of the FTP set up a virtual user, mapping it into a system user)
Useradd-s/sbin/nologin vipftp//-s Specify shell
3, edit the virtual user's password file:
Vim/etc/vsftpd/vsftpd_login
Format: Odd behavior user name, even behavior password
Vipftp
a1234533
Ftp2
b123445
4. Authorizing the password file to 600 (because of password file security)
chmod 600/etc/vsftpd/vsftpd_login
5. Convert the password file into a binary file
Db_load-t-T Hash-f/etc/vsftpd/vsftpd_login
View: Ls-l/etc/vsftpd whether to generate a file with a suffix of db: vsftpd_login.db
6. Create the directory where the virtual user profile resides
Mkdir/etc/vsftpd/vsftpd_user_conf
Create a profile in the directory: (its name requires and the user name is kept in one place)
Vim FTP1//Enter the following:

LOCAL_ROOT=/HOME/VIPFTP/FTP//define home directory for virtual users
Anonymous_enable=no//Whether to allow the GUI user =no
Write_enable=yes//Whether can write =yes
local_umask=022//define permissions when creating a new file
Anon_upload_enable=no//Whether the user is allowed to upload NO
Anon_mkdir_write_enable=no//Whether to allow a GUI user to create a directory and write =no
IDLE_SESSION_TIMEOUT=600//FTP idle time after connection 600s
DATA_CONNECTION_TIMEOUT=120//Data transfer time 120s
MAX_CLIENTS=10//maximum number of connected users

7. Create a virtual user home directory Mkdir/home/vipftp/ftp
and build a file in it: Touch/home/vipftp/ftp/2018.txt
8, modify the permissions of the home directory: Chown vipftp:vipftp/home/vipftp
9. Define where our password files are: (Edit Authentication file)
VIM/ETC/PAM.D/VSFTPD//Add to the front

Auth sufficient/lib64/security/pam_userdb.so Db=/etc/vsftpd/vsftpd_login
Account Sufficient/lib64/security/pam_userdb.so Db=/etc/vsftpd/vsftpd_login
10. Edit the vsftpd.conf configuration file

Change Anonymous_enable=yes to Anonymous_enable=no
Change #anon_upload_enable=yes to Anon_upload_enable=no
Change #anon_mkdir_write_enable=yes to Anon_mkdir_write_enable=no
Then add the following to the bottom of the file:
Chroot_local_user=yes
Guest_enable=yes
Guest_username=vipftp
Virtual_use_local_privs=yes
User_config_dir=/etc/vsftpd/vsftpd_user_conf
Allow_writeable_chroot=yes
Systemctl start vsftpd//Start VSFTPD Service

11. Start: Systemctl start vsftpd
View: PS aux |grep vsftpd
Netstat-lntp

Exportfs commands, NFS room-side issues, 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.