Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Deploy ftp services and deploy ftp yum sources

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Deploy ftp services and deploy ftp yum sources

Deploy ftp to set permissions for individual users

1. Install the ftp service

2. Create a ftp user directory

3. Add ftp users

4. Encrypt the home directory of ftp users to vusers.db

5. Create the virtual user directory specified by the mapping account of the virtual user to give 755 permissions (permissions should be assigned according to the actual needs)

6. Create a directory and set / vat/ftp/soft/ to a directory accessed by anonymous users (set the owner of the directory to a virtual user)

7. Create virtual pam authentication without using the default pam authentication of vsftpd

8. Set permissions for individual users

9. Configure the ftp service (the red line indicates the modified content)

10. Whether the application for enabling the service is successful (the user who uses liyue logs in to create the location where the centos.repo folder is stored as the yum source)

Configure the yum source of ftp

1. Mount the yum files you have prepared into a folder (I will use / mnt/ as an example again)

2. Use anonymous users to check whether there are any files in centos.repo in ftp (you can also verify whether anonymous users have enabled them)

3. Configure the specified location of your yum source file

4. Use yum to install a software to see if it is possible

Detailed command

Mount / dev/cdrom / mnt/ # # Mount CD

Yum-y install vsftpd # install the ftp service

Cd/etc/vsftpd/

Vivusers.list # create a user directory

Db_load-T-t hash-f vusers.list vusers.db # encrypt user directories

Cat vusers.db # check whether the user directory is encrypted

Useradd-d / var/market/-s / sbin/nologin vulab # create a virtual user specified directory

Chmod755 / var/market/ # authorize directories

Ls-ld / var/market/ # View directory permissions

Mkdir/var/ftp/soft # create a directory (equivalent to anonymous)

Chownvulab:vulab / var/ftp/soft/ # specify users

Chmod755 / var/ftp/soft/ # authorization

Ls-ld / var/ftp/soft/

Cd/etc/pam.d/ # pam file directory

Vi/etc/pam.d/vsftpd.vu # Edit a pam authentication

#% PAM-1.0

Auth required pam_userdb.so db=/etc/vsftpd/vusers

Account requiredpam_userdb.so db=/etc/vsftpd/vusers

Cd / etc/vsftpd/

Mkdirvusers_dir # create a user authorization directory

Cdvusers_dir/

Viliyue # user permissions

Anon_mkdir_write_enable=YES # allows users to create and write

Anon_other_write_enable=YES # allow users to create and execute

Local_root=/var/ftp/soft # specify home directory

Vi/etc/vsftpd/vsftpd.conf

(I use blue to mark the places that need to be changed.)

Anonymous_enable=YES

Anonymous_enable=YES

Local_enable=YES

Write_enable=YES

Local_umask=022

Dirmessage_enable=YES

Xferlog_enable=YES

Connect_from_port_20=YES

Xferlog_std_format=YES

Listen=YES

Pam_service_name=vsftpd.vu # modify the specified pam file

Userlist_enable=YES

Tcp_wrappers=YES

Anon_umask=022

Guest_enable=YES

Guest_username=vulab

Anon_root=/var/ftp/soft # specify home directory

Listen_address=192.168.1.10 # ip address of the listener

User_config_dir=/etc/vsftpd/vusers_dir # # specify the user file where the user resides

Mount / dev/cdrom / mnt/ # # Mount CD

Rsync-av / mnt/ / var/ftp/soft/centos.repo/ # # write the mnt file to centos.repo

Vi/etc/yum.repos.d/centos.repo # # Editing YumSource

[local]

Name=local

Baseurl= ftp://192.168.1.10/centos.repo # modified to the address of ftp

Enabled=1

Gpgcheck=0

Yum-y install wget # # verify the installation

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report