Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
09-07-2003, 07:47 AM
|
#1
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Rep:
|
vsftpd, router and external access; Oh my!
I have been looking through here for some help on getting my vsftp setup to allow access from outside of my router (netgear) and spent several days looking here for 'vsftpd', 'vsftpd router', 'vsftpd.conf', 'ftp'. I've even done the RTFM routine with the man files. I'm not running iptable or ipchains on the system that the ftp is supposed to connect to and I'm still having problems. This is what I get when I try to get in from outside the firewall/router 421 Service not available. Connection closed by remote host.
Here are my config files; any help or guidance would be greatley appreciate:
vsftpd.conf
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Welcome to FTP sinkhole
pam_service_name=vsftpd
userlist_enable=YES
listen=YES
tcp_wrappers=YES
-----------------
/etc/xinet.d/vsftpd
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/vsftpd
nice = 10
}
---------------
/etc/pam.d/
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
---------------
chkconfig
vsftpd 0: off 1: off 2: off 3: on 4: off 5: on 6: off
xinetd based services:
vsftpd: on
---------------
netstat
tcp 0 0 *:ftp *:* LISTEN
---------------
router
Port # IP Address
21 192.168.0.2
---------------
/etc/group
ftp:x:50:
ftp-users:x:506: (this is for when I'm ready to set up specific users to use the ftp)
---------------
Last edited by Imyrryr; 09-07-2003 at 07:49 AM.
|
|
|
09-07-2003, 07:54 AM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Have you forwarded port 21 from your router to port 21 on the linux box?
Since you will only be able to see your public address (the one the router has) from outside you need to forward the port to a port on a local machine inside your netowrk - in this case your server.
|
|
|
09-07-2003, 07:58 AM
|
#3
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
Because it's being run through xinetd listen should be no, yes is for standalone
listen=no
Other than that the rough order I'd do things
Check if I can ftp from the actual machine or another internal machine
Check the router has the appropriate ports open and is forwarding to the right place
Check for entries in hosts.allow/hosts.deny that may prevent connections
Double check firewall
|
|
|
09-07-2003, 08:05 AM
|
#4
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Quote:
Originally posted by david_ross
Have you forwarded port 21 from your router to port 21 on the linux box?
Since you will only be able to see your public address (the one the router has) from outside you need to forward the port to a port on a local machine inside your netowrk - in this case your server.
|
router
port 21 192.168.0.2 (this is the linux machine behind the router)
|
|
|
09-07-2003, 08:08 AM
|
#5
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
I'm not saying it'll cure it but you've got to try,listen=yes is for standalone mode xinetd is trying to run vsftpd so it'll handle listening for you and their may be some conflict going on.
|
|
|
09-07-2003, 08:11 AM
|
#6
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Quote:
Originally posted by Looking_Lost
Because it's being run through xinetd listen should be no, yes is for standalone
listen=no
Other than that the rough order I'd do things
Check if I can ftp from the actual machine or another internal machine
Check the router has the appropriate ports open and is forwarding to the right place
Check for entries in hosts.allow/hosts.deny that may prevent connections
Double check firewall
|
I will look at the listen= setting the router is set to forward
port 21 to 192.168.0.2 (this is the linux machine behind the router)
hosts.allow
ALL:192.168.0.0/255.255.255.224
hosts.deny
ALL:ALL
|
|
|
09-07-2003, 08:19 AM
|
#7
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
(root on 1 at aria)(/etc/init.d)-=>./vsftpd status
vsftpd dead but subsys locked
Is this what it supposed to look like?
|
|
|
09-07-2003, 08:21 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
and hosts.allow isn't letting anyone outside your local network access any services tcp_wrapped services like vsftpd
nope, the word "dead" is never a good sign  Looks like there is a conflict
|
|
|
09-07-2003, 08:22 AM
|
#9
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Quote:
Originally posted by Imyrryr
I will look at the listen= setting the router is set to forward
port 21 to 192.168.0.2 (this is the linux machine behind the router)
hosts.allow
ALL:192.168.0.0/255.255.255.224
hosts.deny
ALL:ALL
|
I've changed the listen to no and now I'm getting Connection closed by remote host
Just as a small side note; I have also tried the from a completely different external domain just incase it was the network I'm on may have been part of the problem
|
|
|
09-07-2003, 08:23 AM
|
#10
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
You'ure nearly there
hosts.allow
vsftpd:ALL
|
|
|
09-07-2003, 08:31 AM
|
#11
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Quote:
Originally posted by Looking_Lost
and hosts.allow isn't letting anyone outside your local network access any services tcp_wrapped services like vsftpd
nope, the word "dead" is never a good sign Looks like there is a conflict
|
Pardon my 'cluelessness' on this but if I have different users that are on dhcp network; would I have to open up my entire system (i.e hosts.allow all:all)?
Plus you mentioned a 'conflict'; any ideas on what/where I can look for these?
|
|
|
09-07-2003, 08:36 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
No, but the main thing is to get it working at first
Another point, you have userlist_enable=YES
so if you've got a file with the users who you want to have access in it called
vsftpd.users_list
you should have
userlist_deny=no
|
|
|
09-07-2003, 08:47 AM
|
#13
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Quote:
Originally posted by Looking_Lost
You're nearly there
hosts.allow
vsftpd:ALL
|
 You 'da' man! that did it!
So if I understand this fix correctly
vsftpd.conf should have listen=no
hosts.allow should have vsftpd:ALL
|
|
|
09-07-2003, 09:02 AM
|
#14
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
If you're letting people outside your network have access unless you know their IP addresses i.e they are static ip's you'd be aswell to leave the
vsftpd:ALL
as it is
If you want to allow access to only certain users create the file in /etc or something like /etc/vsftp if that's the directory you got, name it
vsftpd.user_list
add the name of the users who you want to allow access to the server to this file
and add
userlist_deny=no to vsftpd.conf
if you don't want to allow anonymous access set it to no although if you use the vsftpd.user_list thing and anonymous user isn't in the list theyll be denied access
Anyway...off you go
Oh and
chroot_local_user=YES
to keep users within they're home directory
Last edited by Looking_Lost; 09-07-2003 at 09:04 AM.
|
|
|
09-07-2003, 09:22 AM
|
#15
|
Member
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140
Original Poster
Rep:
|
Thank you all for your help and this trail of dialog is going into my fixit folder and on the box itself incase I goof it up again. Not to mention going to back up the /etc/ folder  .
You folks are awesome and it's stuff like this that reaffirms my belief in the OS model and  in general as a useful alternative to Wynbl  z.
Last edited by Imyrryr; 09-07-2003 at 09:23 AM.
|
|
|
All times are GMT -5. The time now is 01:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|