Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having problems connecting to my ftp server. Whenever i try to connect i receive a message "Connected to 10.0.0.3" (which is my server) and then nothing, until it times out and a get a "Connection closed by remote server" message.
In the past, I was able to try this several times until it did work, and I did connect correctly to the server. The connection worker perfectly from then on.
However, since yesterday I have been unable to make the connection, no matter how many times i try.
The version i'm using is wu-ftpd-2.6.1-16, and it makes no difference which client i'm using to connect to it.
Please note that i am able to connect to the server using telnet or http, only the ftp isn't working.
add the ip address and host name to the /etc/hosts file where you are connecting from, so the ftp server can resolve it.
Also, check /etc/xinit.d/wu-ftpd, and make sure it is not disabled.
there should be line says: disable=no
if it is says disable=yes, then change it to 'no' and restart
the xinet:
#/etc/rc.d/init.d/xinet restart
That probably will fix the problem. let me know if it does or not.
Good luck.
Thank you very much for your help. Although it's taking about 40 seconds for the ftp to connect, it does connect, so i can work.
However i would like to allow my whole intranet to access the server, and due to my very scarce knowledge of the linux system, i don't know how to do so.
I would like to allow from 10.0.0.1 to 10.0.0.255. What entry should a place into the hosts file? And how would i allow any address to access the server?
If you want restrict ftp client access and only allow connection from 10.0.0.1 to 10.10.0.255 range, then add following line to the /etc/xinet.d/wu-ftpd:
only_from = 10.0.0.0/24
This allows the whole subnet on 10.0.0.0/24 to connect; if you want exclude say 10.0.0.8 for some reason, then add this line in front of the above line:
no_access = 10.0.0.8
And if you want to more secure and only allow a few hosts, then you put the ip address instead of the network address. And if you want more detailed log on ftp connections, then modify the the file so it looks like this:
In terms why it takes 40s to receive the ftp prompt is likely a DNS related issue - Your linux box tries to resove the incoming ip address to a host ip, but since you are on 10.x.x.x, it cannot resove using default DNS server, then it tries next DNS, and next... that's why you get long delay. Try to modify your /etc/resolve.conf and /etc/hosts, so your linux box have knowledge of the IPs and names that you are going to connect from.
Also there are couple of other files you should take look and modify to your need:
/etc/ftpusers - users denied ftp access
/etc/ftpaccess - how access it is controlled/logged, etc
/home/user/.netrc user enviromental parameters
All the info you gave me was very useful, however i was refering to the hosts file configuration, and not the ftp configuration.
In your first reply, you stated that i needed to add the ip of the computer i was connecting from into the hosts file. I did that, and now I can connect from that computer. I cannot however connect from any other computer which is not in the hosts file.
I wanted to allow all my intranet to access the ftp, and not only my computer.
So, is there any way to insert a range of ips into the hosts file?
And by the way, why would the ftp need the computer which is accessing it to be listed in the hosts file?
Thank you,
Ivan
PS. This message was sent before i read the second part of you response.
Now, after reading your last response, I detected a little difference here.
I don't have any resolve.conf, but a resolv.conf file. Is that correct? Should i rename it?
And is there any way to tell the ftp not to look up for the domain name of the ip that is connecting to it?
Sorry, my typo, don't rename that file, /etc/resolv.conf is correct name. What content do you have in this file? It must contains the correct DNS servers ip address (not names), otherwise your system will be slow or timeout with name lookup. And also, you must have the correct lookup sequence in order for the system have speedy name lookup. If you don't have internal DNS which delegate for your 10.0.0.0 net, then you should tell your system to look up /etc/hosts before send querey to DNS server.
Secondly, you might want tell your system do NOT perform a reverse lookup anytime it receives ftp connection. This will improve the lagging you see now with your initial ftp login.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.