Centos5.5 vsftp虚拟账户建立

今天测试vsftp虚拟账户配置,到现在为止还没成功,问题是虚拟账户无法登陆,

查看日志  more /var/log/secure

1Mar 23 14:42:26 localhost vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=test rhost=192.168.14.24 2Mar 23 14:42:26 localhost vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user test 3Mar 23 14:44:29 localhost vsftpd: PAM unable to dlopen(/lib/security/pam_userdb.so) 4Mar 23 14:44:29 localhost vsftpd: PAM [error: /lib/security/pam_userdb.so: wrong ELF class: ELFCLASS32] 5Mar 23 14:44:29 localhost vsftpd: PAM adding faulty module: /lib/security/pam_userdb.so 6Mar 23 14:44:29 localhost vsftpd: pam_listfile(vsftpd:auth): Couldn't open /etc/vsftpd/wdftp 7Mar 23 14:44:29 localhost vsftpd: pam_unix(vsftpd:auth): check pass; user unknown 8Mar 23 14:44:29 localhost vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=test rhost=192.168.14.24 9Mar 23 14:44:29 localhost vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user test

下面将我的配置过程写出来,望大家能帮我指正一下,也希望能给后来者一个提示,如有不详细处请回复:

1.环境VirtualBoax  **Centos5.5(64位),**vsftp2.0.5

2.基础软件安装

 yum -y install vsftpd*
  yum -y install pam*
  yum -y install db4*

3.新建useradd wdftp -s  /sbin/nologin

4.新建虚拟账户用户文件

 vi /etc/vsftpd/vsftpd_login

1test 2123456 3hello 4123321ab

5.生成虚拟账户DB文件

db_load -T -t hash -f /etc/vsftpd/vsftpd_login  /etc/vsftpd/vsftpd_login.db 

6.新建虚拟账户目录/etc/vsftpd/vsftpd_user_conf,并将第4步中用户一一创建一个文件,其中test用户的配置如下,其它账户一样

1local_root=/var/ftp/pub/ 2#anonymous_enable=NO 3write_enable=YES 4#local_umask=022 5#anon_upload_enable=NO 6#anon_mkdir_write_enable=NO 7#idle_session_timeout=600 8#data_connection_timeout=120 9#max_clients=10 10#max_per_ip=5 11#local_max_rate=50000

7.修改vi /etc/pam.d/vsftpd

1#%PAM-1.0 2auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login 3account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login 4 5session optional pam_keyinit.so force revoke 6auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/wdftp onerr=succeed 7auth required pam_shells.so 8auth include system-auth 9account include system-auth 10session include system-auth 11session required pam_loginuid.so

8.vsftpd.conf 配置

1# The default compiled in settings are fairly paranoid. This sample file 2# loosens things up a bit, to make the ftp daemon more usable. 3# Please see vsftpd.conf.5 for all compiled in defaults. 4# 5# READ THIS: This example file is NOT an exhaustive list of vsftpd options. 6# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's 7# capabilities. 8# 9# Allow anonymous FTP? (Beware - allowed by default if you comment this out). 10anonymous_enable=NO 11# 12# Uncomment this to allow local users to log in. 13local_enable=YES 14# 15# Uncomment this to enable any form of FTP write command. 16write_enable=YES 17# 18# Default umask for local users is 077. You may wish to change this to 022, 19# if your users expect that (022 is used by most other ftpd's) 20local_umask=022 21# 22# Uncomment this to allow the anonymous FTP user to upload files. This only 23# has an effect if the above global write enable is activated. Also, you will 24# obviously need to create a directory writable by the FTP user. 25anon_upload_enable=NO 26# 27# Uncomment this if you want the anonymous FTP user to be able to create 28# new directories. 29anon_mkdir_write_enable=NO 30# 31# Activate directory messages - messages given to remote users when they 32# go into a certain directory. 33dirmessage_enable=YES 34# 35# Activate logging of uploads/downloads. 36xferlog_enable=YES 37# 38# Make sure PORT transfer connections originate from port 20 (ftp-data). 39connect_from_port_20=YES 40# 41# If you want, you can arrange for uploaded anonymous files to be owned by 42# a different user. Note! Using "root" for uploaded files is not 43# recommended! 44#chown_uploads=YES 45#chown_username=whoever 46# 47# You may override where the log file goes if you like. The default is shown 48# below. 49xferlog_file=/var/log/vsftpd.log 50# 51# If you want, you can have your log file in standard ftpd xferlog format 52xferlog_std_format=YES 53# 54# You may change the default value for timing out an idle session. 55#idle_session_timeout=600 56# 57# You may change the default value for timing out a data connection. 58#data_connection_timeout=120 59# 60# It is recommended that you define on your system a unique user which the 61# ftp server can use as a totally isolated and unprivileged user. 62nopriv_user=vsftpd 63# 64# Enable this and the server will recognise asynchronous ABOR requests. Not 65# recommended for security (the code is non-trivial). Not enabling it, 66# however, may confuse older FTP clients. 67async_abor_enable=YES 68# 69# By default the server will pretend to allow ASCII mode but in fact ignore 70# the request. Turn on the below options to have the server actually do ASCII 71# mangling on files when in ASCII mode. 72# Beware that on some FTP servers, ASCII support allows a denial of service 73# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd 74# predicted this attack and has always been safe, reporting the size of the 75# raw file. 76# ASCII mangling is a horrible feature of the protocol. 77ascii_upload_enable=YES 78ascii_download_enable=YES 79# 80# You may fully customise the login banner string: 81ftpd_banner=Welcome to FTP service. 82# 83# You may specify a file of disallowed anonymous e-mail addresses. Apparently 84# useful for combatting certain DoS attacks. 85#deny_email_enable=YES 86# (default follows) 87#banned_email_file=/etc/vsftpd/banned_emails 88# 89# You may specify an explicit list of local users to chroot() to their home 90# directory. If chroot_local_user is YES, then this list becomes a list of 91# users to NOT chroot(). 92#chroot_list_enable=YES 93# (default follows) 94#chroot_list_file=/etc/vsftpd/chroot_list 95# 96# You may activate the "-R" option to the builtin ls. This is disabled by 97# default to avoid remote users being able to cause excessive I/O on large 98# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume 99# the presence of the "-R" option, so there is a strong case for enabling it. 100#ls_recurse_enable=YES 101# 102# When "listen" directive is enabled, vsftpd runs in standalone mode and 103# listens on IPv4 sockets. This directive cannot be used in conjunction 104# with the listen_ipv6 directive. 105listen=YES 106# 107# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 108# sockets, you must run two copies of vsftpd whith two configuration files. 109# Make sure, that one of the listen options is commented !! 110#listen_ipv6=YES 111chroot_local_user=YES 112pam_service_name=vsftpd 113userlist_enable=YES 114tcp_wrappers=YES 115guest_enable=YES 116guest_username=wdftp 117virtual_use_local_privs=YES 118user_config_dir=/etc/vsftpd/vsftpd_user_conf

9.重启service vsftpd restart
 

我重新将虚拟机中的linux删掉重新装了一篇,然后重新配置vsftp,按上面的步骤成功了!所以流程上是没有问题的,希望能给各位一点参考。

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

国庆假期玩不停双重好礼放肆领

自2021年10月1日00:00起至2021年10月7日24:00,新注册并激活(需全部完成账号注册的五个步骤,否则账号状态并未激活)AWS海外区域账户,填写页面下方表单,即可申领价值$200美元的AWS海外区域账户服务抵扣券直充到您的账户,用以抵扣服务消费,助您轻松体验多个云迁移应用场景。同时,您还可获赠AWS精美祥云纪念T恤一件。,仅限7天AW

Centos5.5 vsftp虚拟账户建立 - HelloWorld