# # # #文件共享 # #
1. Install the shared access client
Yum Install Samba-client-y
2. Identify shared server shared directory
Smbclient-l//172.25.254.253
3. Accessing the Share
Command access)
Smbclient//172.25.254.253/westos
Mount access)
Mount//172.25.254.253/westos/mnt-o Username=guest
4. Auto Mount
Method 1)
Vim/etc/fstab
172.25.254.253/westos/mnt CIFS defaults,username=guest 0 0
Method 2)
Vim/etc/rc.d/rc.local
Mount//172.25.254.253/westos/mnt-o Username=guest
chmod 755/etc/rc.d/rc.local
# # # #nfs网络文件系统访问 # #
1. Installing Access sharing software
Yum Install Nfs-utils-y
2. Identify shares
SHOEMOUNT-E 172.25.254.250
3. Use shared
Mount 172.25.254.250:/nfsshare/nfs1/mnt
4. Auto Mount
Method 1)
Vim/etc/fstab
172.25.254.250:/nfsshare/nfs1/mnt NFS Defaults 0 0
Method 2)
Vim/etc/rc.d/rc.local
Mount 172.25.254.250:/nfsshare/nfs1/mnt
chmod 755/etc/rc.d/rc.local
# # # #autofs自动挂载服务 # #
1. Service function
When you use Mount Share by default, when you do not use a shared
Wasting Shared server resources
AutoFS can be automatically mounted when used and automatically unloaded when not in use
2. Installation Services
Yum Install Autofs-y
Systemctl Start AutoFS
3. Access
Cd/net/172.25.254.250/nfsshare/nfs1
4. Set Idle unload time
Vim/etc/autofs.conf
The timeout = # #闲置300妙后自动卸载 (customizable change)
###############
# # # #vsftpd服务 #####
###############
What is FTP
FTP is the abbreviation for file Transfer Protocol (document Transfer Protocol), and Chinese is called "Interfax protocol". Used for two-way transmission of control files on the Internet. At the same time, it is also an application (application). There are different FTP applications based on different operating systems, and all of these applications follow the same protocol to transfer files.
2. Install FTP
Yum Install Vsftpd-y
Systemctl Start VSFTPD
Systemctl Stop Firewalld
Systemctl Enable VSFTPD
Setenforce 0 # #临时关闭selinux
Lftp 172.25.254.254 # #能登陆并显示, indicating successful installation
3.VSFTPD File Information
/VAR/FTP # #默认发布目录
/ETC/VSFTPD # #配置目录
Configuration parameters for 4.VSFTPD services
1) Anonymous user settings
Anonymous_enable=yes|no # #匿名用户登陆限制
#< Anonymous user uploads >
Vim/etc/vsftpd/vsftpd.conf
Write_enable=yes
Anon_upload_enable=yes
Chgrp ftp/var/ftp/pub
chmod 775/var/ftp/pub
#< Anonymous user home directory modification >
Anon_root=/directory
#< Anonymous user upload file default permissions modification >
Anon_umask=xxx
#< Anonymous user build directory >
Anon_mkdir_write_enable=yes|no
#< Anonymous user Download >
Anon_world_readable_only=yes|no # #设定为NO后表示匿名用户可以下载
#< Anonymous User Delete >
Anon_other_write_enable=yes|no
#< user identity modification used by anonymous users >
Chown_uploads=yes
Chown_username=statudent
#< Max upload rate >
anon_max_rate=102400
#< Maximum number of links >
max_clients=2
2) Local User settings
Local_enable=yes|no # #本地用户登录限制
Write_enable=yes|no # #本地用户写权限限制
#< Local User home Directory modification >
Local_root=/directory
#< Local user upload file permissions >
Local_umask=xxx
#< restrict local users from browsing the root directory >
All users are locked into their home directory
Chroot_local_user=yes
chmod u-w/home/*
User blacklist establishment
Chroot_local_user=no
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd/chroot_list
User Whitelist Creation
Chroot_local_user=yes
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd/chroot_list
#< Restrict local User login >
Vim/etc/vsftpd/ftpusers # #用户黑名单
Vim/etc/vsftpd/user_list # #用户临时黑名单
User White list settings
Userlist_deny=no
/etc/vsftpd/user_list # #参数设定, this file becomes a user whitelist
#<ftp settings for virtual users >
Create a virtual account identity)
Vim/etc/vsftpd/loginusers # #文件名称任意
Ftpuser1
123
Ftpuser2
123
Ftpuser3
123
DB load-t-T hash-f/etc/vsftpd/loginusers loginusers.db
VIM/ETC/PAM.D/CKVSFTPD # #文件名任意
Account Required Pam_userdb.so Db=/etc/vsftpd/loginusers
Auth Required pam_userdb.so Db=/etc/vsftpd/loginusers
Vim/etc/vsftpd/vsftpd.conf
Pam_service_name=ckvsftpd
Guest_enable=yes
Virtual Account Identity Designation
Guest_username=ftpuser
chmod u-w/home/ftpuser
Virtual Account Home directory independent settings
Vim/etc/vsftpd/vsftpd.conf
local_root=/ftpuserhome/$USER
user_sub_token= $USER
Mkdir/ftpuserhome
Chgrp Ftpusers/ftpuserhome
chmod g+s/ftpuserhome
################
# # # # #ldap服务 # # #
################
1.
2.LDAP client required software
Yum SSSD krb5-workstation-y
3. How to turn on LDAP user authentication
1) Get authentication
Because the TLS certificate is missing, you need to download the required certificate to the server side to/etc/ Openldap/cacerts,
command used
wget http://172.25.254.254/pub/example-ca.crt
Authconfig-tui
and then a bunch of graphs
< test;
Getent passwd ldapuser1
If the user information can be displayed properly, prove client success
List all users
vim/etc/sssd/sssd.conf
Enumerate = true # #列出隐藏用户 (added on line 16th)
Systemctl restart SSSD
4. Automatically mount user home directory
Yum Install Autofs-y
Vim/etc/auto.master
/home/guests /etc/auto.ldap (added in/net -hosts the line below)
Vim/etc/auto.ldap
ldapuser1 172.25.254.254:/home/guests/ Ldapuser1
#######################################################################
* 172.25.254.254:/home/guests/&
Systemctl restart AutoFS
Systemctl enable AutoFS
5. A script
Linux Basic Learning (14) NFS, VSFTPD services, etc.