|
机器在一个路由后面。路由上做的NAT,断口已经映射到vsftpd所在服务器
通过路由器的公网IP访问,能登陆,不能列目录、下载
[code:1]
[root@www vsftpd]# ftp 61.52.112.30 2121
Connected to 61.52.112.30.
220 ▒▒ӭ▒▒▒ ▒▒FTP▒▒▒▒▒▒
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (61.52.112.30:root): ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,0,9,195,83)
425 Security: Bad IP connecting.
ftp> pwd
257 "/"
ftp> size 1111
213 0
ftp> get 1111
local: 1111 remote: 1111
227 Entering Passive Mode (192,168,0,9,195,83)
425 Security: Bad IP connecting.
ftp> bye
221 Goodbye.
[/code:1]
但是直接在内网连vsftpd所在的服务器可以下载
[code:1]
[root@www vsftpd]# ftp 192.168.0.9 2121
Connected to 192.168.0.9.
220 ▒▒ӭ▒▒▒ ▒▒FTP▒▒▒▒▒▒
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.0.9:root): ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> ls
227 Entering Passive Mode (192,168,0,9,195,80)
150 Here comes the directory listing.
-rw-rw-rw- 1 ftp ftp 0 Feb 09 22:52 1111
drwxrwxrwx 2 ftp ftp 4096 Feb 09 18:12 pub
226 Directory send OK.
ftp> get 1111
local: 1111 remote: 1111
227 Entering Passive Mode (192,168,0,9,195,82)
150 Opening BINARY mode data connection for 1111 (0 bytes).
226 File send OK.
ftp> bye
221 Goodbye.[/code:1]
这是我的vsftpd.conf
[code:1]
[root@www vsftpd]# cat vsftpd.conf
listen=YES
listen_port=2121
port_enable=NO
pasv_enable=YES
pasv_min_port=50000
pasv_max_port=50009
ascii_upload_enable=NO
ascii_download_enable=NO
idle_session_timeout=120
data_connection_timeout=120
accept_timeout=60
max_clients=100
max_per_ip=2
anonymous_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
local_enable=YES
local_root=/home/vsftpdvirtual/
guest_enable=YES
guest_username=vsftpdvirtual
pam_service_name=vsftpd
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO
tcp_wrappers=NO
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list
##chroot_local_users=NO
hide_ids=YES
ls_recurse_enable=NO
write_enable=YES
file_open_mode=0666
local_umask=022
ftpd_banner=▒▒ӭ▒▒▒ ▒▒FTP▒▒▒▒▒▒
banner_file=/etc/vsftpd/vsftpd_banner_file
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
log_ftp_protocol=NO
setproctitle_enable=NO
#text_userdb_names=YES
use_localtime=YES
[/code:1]
这是我的vsftpd的pam配置文件
[code:1]
[root@www vsftpd]# cat /etc/pam.d/vsftpd
#%PAM-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
#auth required pam_stack.so service=system-auth
#auth required pam_shells.so
#account required pam_stack.so service=system-auth
#session required pam_stack.so service=system-auth
#session required pam_loginuid.so
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/account
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/account
[/code:1]
ftp的根目录已经是所有人可读写执行
[code:1]
drwxrwxrwx 3 vsftpdvirtual vsftpdvirtual 4096 2月 9 23:05 vsftpdvirtual
[/code:1]
感觉还是虚拟用户、pam认证这一块出错了,但是不知道该怎么弄了,郁闷阿,谁来帮帮我。谢谢 |
|