LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   VSFTP No Socket error (https://www.linuxquestions.org/questions/linux-software-2/vsftp-no-socket-error-421300/)

kyletriggs 03-03-2006 12:05 PM

VSFTP No Socket error
 
I recently built a new FC4 machine with the hardware listed below. I have everything I need up and running except for VSFTPD. When I try to connect to my server from within the network it will say "606 NO SOCKET." I'm fairly new to this sort of stuff so any help is greatly appreciated. Here is a copy of my vsftpd.conf:
Code:

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
chroot_local_user=YES
passwd_chroot_enable=YES
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES


jcliburn 03-03-2006 07:17 PM

Sounds like a client-side error. What OS are you running on the client? What ftp client are you using? ("which ftp" should show that if you're running Linux/Unix on the client.) Can you cut and paste the actual ftp command session and post it here? Do you have a firewall blocking outbound ephemeral port traffic from the client?

You've enabled tcp_wrapper support in vsftpd.conf; have you configured /etc/hosts.allow and /etc/hosts.deny?

Is vsftpd actually running on the server? The command "service vsftpd status" should answer that. Do you have a firewall blocking port 21 at the server?

Post the output of "netstat --proto=inet,inet6 -pnl" from the server.

kyletriggs 03-03-2006 10:09 PM

I'm using Windows XP professional for the client, and WSFTP Pro. Heres a copy of the session:
WINSOCK.DLL: WinSock 2.0
WS_FTP Pro, Version 7.02, 2001.10.01
Connecting to 192.168.1.8:21
Connected to 192.168.1.8:21, Waiting for Server Response
220 (vsFTPd 2.0.3)
Host type (1): Automatic detect
USER ktriggs
331 Please specify the password.
PASS (hidden)
606 no socket

The outbound traffic isn't being blocked either.
I'm not quite sure how to configure /etc/hosts.allow and /etc/hosts.deny, but I looked in those files and found nothing but headers. The VSFTPD service is running and port 21 is forwarded to the correct IP on my router.

Here is the output after running the "netstat --proto=inet,inet6 -pnl" command:

Code:

[root@haze ~]# netstat --proto=inet,inet6 -pnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address              Foreign Address            Stat
e      PID/Program name
tcp        0      0 0.0.0.0:139                0.0.0.0:*                  LIST
EN      2517/smbd
tcp        0      0 0.0.0.0:111                0.0.0.0:*                  LIST
EN      2093/portmap
tcp        0      0 0.0.0.0:10000              0.0.0.0:*                  LIST
EN      2599/perl
tcp        0      0 0.0.0.0:51986              0.0.0.0:*                  LIST
EN      2111/rpc.statd
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                  LIST
EN      2399/vsftpd
tcp        0      0 127.0.0.1:631              0.0.0.0:*                  LIST
EN      2350/cupsd
tcp        0      0 127.0.0.1:5335              0.0.0.0:*                  LIST
EN      2332/mDNSResponder
tcp        0      0 127.0.0.1:25                0.0.0.0:*                  LIST
EN      2424/sendmail: acce
tcp        0      0 0.0.0.0:445                0.0.0.0:*                  LIST
EN      2517/smbd
tcp        0      0 :::80                      :::*                        LIST
EN      2459/httpd
tcp        0      0 :::22                      :::*                        LIST
EN      2390/sshd
tcp        0      0 :::443                      :::*                        LIST
EN      2459/httpd
udp        0      0 0.0.0.0:32768              0.0.0.0:*
        2111/rpc.statd
udp        0      0 127.0.0.1:32769            0.0.0.0:*
        2604/smbd
udp        0      0 192.168.1.8:137            0.0.0.0:*
        2519/nmbd
udp        0      0 0.0.0.0:137                0.0.0.0:*
        2519/nmbd
udp        0      0 192.168.1.8:138            0.0.0.0:*
        2519/nmbd
udp        0      0 0.0.0.0:138                0.0.0.0:*
        2519/nmbd
udp        0      0 0.0.0.0:10000              0.0.0.0:*
        2599/perl
udp        0      0 0.0.0.0:5353                0.0.0.0:*
        2332/mDNSResponder
udp        0      0 0.0.0.0:111                0.0.0.0:*
        2093/portmap
udp        0      0 0.0.0.0:631                0.0.0.0:*
        2350/cupsd
udp        0      0 0.0.0.0:1015                0.0.0.0:*
        2111/rpc.statd


jcliburn 03-04-2006 07:39 AM

Do you have an option to disable passive (PASV) mode transfers in your client? If so, try it.

jcliburn 03-04-2006 08:01 AM

Something in your reply just caught my eye. You say you're forwarding port 21 on your router... Is your XP client on a different subnet than your FC4 server? If so, you'll have to forward the ftp-data port(s), too, and unfortunately those port numbers vary from session to session. You'll need to configure vsftpd to use a constrained range of ports for passive mode data transfers. Add the following to vsftpd.conf.

pasv_min_port=11000
pasv_max_port=11010

This causes vsftpd to listen for passive mode transfers on ports 11000 through 11010, and it will instruct clients to initiate the ftp-data connection within that port range.

You'll need to unblock those ports on the server's firewall (iptables -A INPUT -p tcp --dport 11000:11010), and you'll need to add them to the list of forwarded ports on your router. You can expand or shrink the number of ports by adjusting pasv_min_port and pasv_max_port accordingly, but remember to modify iptables and your router's port forwarding list if you do that.

kyletriggs 03-04-2006 05:26 PM

Ok, I did that, but I changed the ports to 2300 through 2500. I don't get the same "no socket" error, but I do now get this:

WINSOCK.DLL: WinSock 2.0
WS_FTP Pro, Version 7.02, 2001.10.01
Connecting to 192.168.1.8:21
Connected to 192.168.1.8:21, Waiting for Server Response
220 (vsFTPd 2.0.3)
Host type (1): Automatic detect
USER ktriggs
331 Please specify the password.
PASS (hidden)
500 OOPS: cannot change directory:/storage/WD250

thanks again!

jcliburn 03-04-2006 05:55 PM

Go to this thread and search for your error. (It'll be easy to find. It's at the bottom.) You'll find that the cause of your error comes from SELinux.

http://forums.fedoraforum.org/showthread.php?t=97374

kyletriggs 03-04-2006 07:37 PM

jcliburn Thanks so much for all your help. It looks like the problem is resolved and the ftp service is working properly. One final question. Do you know how to tell which users you have logged on to the server? thanks.

jcliburn 03-04-2006 08:06 PM

Add the following line to /etc/vsftpd/vsftpd.conf

dual_log_enable=YES

Then restart vsftpd.

Thereafter, you can see ftp logins by viewing /var/log/vsftpd.log. There's probably a way to torture logwatch into producing a list nicely formatted, but I've never done it.

kyletriggs 03-04-2006 08:17 PM

I don't have a /var/log/vsftpd.log file.

EDIT:
I actually found another way.
by entering 'ps -ef |grep vsftp'

kyletriggs 03-05-2006 02:07 AM

ok, after I had a friend try to connect to my FTP server from outside my network and he couldn't connect using PASV but non-PASV worked wonderous. I want the PASV to work. He told me to add this : pasv_address=24.27.154.210 to the .conf and I did that, but still no go. It just times out. any ideas?

jcliburn 03-05-2006 08:01 AM

I presume you have a router at your network border? If so, you need to configure it to forward ports 2300 through 2500 (since that's the range of passive ports you enabled).

kyletriggs 03-05-2006 12:34 PM

well I actually already had it setup from a previous server and it was ports 2300 through 2800 so I changed everything to that including the forwared ports on my router...still no luck. Thanks so much for your prompt replies, this is truly the exact sort of forum I've been searching for. I really appreciate it.

jcliburn 03-05-2006 12:47 PM

About the only thing I can recommend at this point is to initiate a packet capture on your server using ethereal while your friend attempts a passive mode transfer.

yum install ethereal ethereal-gnome

Using this, you'll be able to see what the actual communication between the client and server looks like, and you might be able to tell where it's failing.

Would you mind posting your firewall rules? Run the command "/sbin/iptables -L -n" and copy and paste the output here. Sanitize if you wish by masking important IP addresses.

kyletriggs 03-05-2006 01:49 PM

I never mentioned that I was running firestarter for my firewall, but here is the output when I type that command:
Code:

Chain FORWARD (policy DROP)
target    prot opt source              destination
ACCEPT    icmp --  0.0.0.0/0            0.0.0.0/0          limit: avg 10/sec burst 5
LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0
LOG        all  --  0.0.0.0/0            0.0.0.0/0          LOG flags 0 level 6 prefix `Unknown Forward'

Chain INBOUND (1 references)
target    prot opt source              destination
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
ACCEPT    all  --  192.168.1.0          0.0.0.0/0
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpts:137:139
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpts:137:139
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:445
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:445
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:80
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:80
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpts:20:21
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpts:20:21
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:22
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:22
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:10000
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:10000
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpts:2300:2800
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpts:2300:2800
LSI        all  --  0.0.0.0/0            0.0.0.0/0

Chain INPUT (policy DROP)
target    prot opt source              destination
ACCEPT    tcp  --  192.168.1.1          0.0.0.0/0          tcp flags:!0x16/0x02
ACCEPT    udp  --  192.168.1.1          0.0.0.0/0
ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT    icmp --  0.0.0.0/0            0.0.0.0/0          limit: avg 10/sec burst 5
DROP      all  --  0.0.0.0/0            255.255.255.255
DROP      all  --  0.0.0.0/0            192.168.1.255
DROP      all  --  224.0.0.0/8          0.0.0.0/0
DROP      all  --  0.0.0.0/0            224.0.0.0/8
DROP      all  --  255.255.255.255      0.0.0.0/0
DROP      all  --  0.0.0.0/0            0.0.0.0
DROP      all  --  0.0.0.0/0            0.0.0.0/0          state INVALID
LSI        all  -f  0.0.0.0/0            0.0.0.0/0          limit: avg 10/min burst 5
INBOUND    all  --  0.0.0.0/0            0.0.0.0/0
LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0
LOG        all  --  0.0.0.0/0            0.0.0.0/0          LOG flags 0 level 6 prefix `Unknown Input'

Chain LOG_FILTER (5 references)
target    prot opt source              destination

Chain LSI (2 references)
target    prot opt source              destination
LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0
LOG        tcp  --  0.0.0.0/0            0.0.0.0/0          tcp flags:0x16/0x02 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix `Inbound '
DROP      tcp  --  0.0.0.0/0            0.0.0.0/0          tcp flags:0x16/0x02
LOG        tcp  --  0.0.0.0/0            0.0.0.0/0          tcp flags:0x17/0x04 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix `Inbound '
DROP      tcp  --  0.0.0.0/0            0.0.0.0/0          tcp flags:0x17/0x04
LOG        icmp --  0.0.0.0/0            0.0.0.0/0          icmp type 8 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix `Inbound '
DROP      icmp --  0.0.0.0/0            0.0.0.0/0          icmp type 8
LOG        all  --  0.0.0.0/0            0.0.0.0/0          limit: avg 5/sec burst 5 LOG flags 0 level 6 prefix `Inbound '
DROP      all  --  0.0.0.0/0            0.0.0.0/0

Chain LSO (0 references)
target    prot opt source              destination
LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0
LOG        all  --  0.0.0.0/0            0.0.0.0/0          limit: avg 5/sec burst 5 LOG flags 0 level 6 prefix `Outbound '
REJECT    all  --  0.0.0.0/0            0.0.0.0/0          reject-with icmp-port-unreachable

Chain OUTBOUND (1 references)
target    prot opt source              destination
ACCEPT    icmp --  0.0.0.0/0            0.0.0.0/0
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy DROP)
target    prot opt source              destination
ACCEPT    tcp  --  192.168.1.8          192.168.1.1        tcp dpt:53
ACCEPT    udp  --  192.168.1.8          192.168.1.1        udp dpt:53
ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0
DROP      all  --  224.0.0.0/8          0.0.0.0/0
DROP      all  --  0.0.0.0/0            224.0.0.0/8
DROP      all  --  255.255.255.255      0.0.0.0/0
DROP      all  --  0.0.0.0/0            0.0.0.0
DROP      all  --  0.0.0.0/0            0.0.0.0/0          state INVALID
OUTBOUND  all  --  0.0.0.0/0            0.0.0.0/0
LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0
LOG        all  --  0.0.0.0/0            0.0.0.0/0          LOG flags 0 level 6 prefix `Unknown Output'



All times are GMT -5. The time now is 09:30 AM.