In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
vsftpd is based on mysql service implementation:
Check if pam-mysql is in maradb, under directory/lib64/security/.
No, just compile and install pam-mysql.
Steps:
1. # yum -y groupinstall "Development Tools" "Server Platform Development"
2. # yum -y install pam-devel openssl-devel mariadb-devel mariadb-server
3. # ./ configure --with-mysql=/usr --with-openssl=/usr --with-pam=/usr --with-pam-mods-dir=/lib64/security
Note: Use./ configure -help View configuration instructions
# make && make install
4. Then create database and table in mysql database, and define three fields id, name and passwd in table. authorization, etc.
In this step, you need to create the following:
Connect to database: use mysql command after opening mariadb service
a, CREATE DATABASE vsftpd;##Create database
b. use vsftpd;#switch to database
c. CREATE TABLE users (id int AUTO_INCREMENT NOT NULL PRIMARY KEY,name char(30) NOT NULL,password char(48) binary NOT NULL );##Create table
d. INSERT INTO users(name,password) VALUES ('tom ',password ('mageedu'));##Create a user
e. INSERT INTO users(name,password) VALUES ('jerry ',password ('mageedu'));##Create a user
f, SELECT * FROM users;##View tables
g、GRANT select ON vsftpd.* TO vsftpd@'127.0.0.1' IDENTIFIED BY 'mageedu';##AUTHORIZED USER
h、FLUSH PRIVILEGES;
Exit, you can connect to the database again, check whether the database and table are created and whether the contents of the table are successful.
5. pam configuration file; there is a vsftpd in the directory/etc/pam.d/, but when you use it, you need to recreate the configuration file. Create vsftpd.mysql in the directory/etc/pam.d/and add the following contents: (Note that the following contents are added to the database in the previous step)
auth required pam_mysql.so user=vsftpd passwd=mageedu host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=2(encryption method type)
account required pam_mysql.so user=vsftpd passwd=mageedu host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=2
6. Create user: useradd -s /sbin/nologin -d /ftproot vuser
chmod go+rx /ftproot/
Configuration file: Add pam_service_name=vsftpd.mysql to the configuration file/etc/vsftpd/vsftpd.conf
gusest_enable=YES
gusest_username=vuser
At the same time make sure that the above configuration is correct.
7. At this point, try another host to see if you can log in successfully.
You can modify the configuration file to play with functions such as viewing uploads.
8. If only one user is allowed to upload, you can do so by:
a. First annotate the upload function in the main configuration file
b. Create a user-specific configuration file directory/etc/vsftpd/vusers.conf.d In this directory vim tom Add anon_upload_enable=YES to tom file
vim jerry adds anon_upload_enable=NO to this file
c. At this time, to explicitly tell vsftpd to use the user configuration directory in the main configuration file, add user_config_dir=/etc/vsftpd/vusers.conf.d/to the main configuration file.
d. Restart service
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.