Installed vsftpd, ftp not running - need help for settings

Issues related to configuring your network
Post Reply
vikram8jp
Posts: 9
Joined: 2008/10/15 04:16:18

Installed vsftpd, ftp not running - need help for settings

Post by vikram8jp » 2008/10/16 02:27:21

Hello all,

I am trying to setup a FTP on my CentOS version 4.7. I installed the package vsftpd using the command
[code]# yum -y install vsftpd[/code]

The edited the vsftpd.conf file lie this:
[code]
# Example config file /etc/vsftpd/vsftpd.conf
listen=YES
listen_port=21
listen_address=192.168.1.12
background=YES
ftpd_banner=Welcome to Test FTP Server
check_shell=NO
anonymous_enable=NO
no_anon_password=NO
guest_enable=NO
ascii_download_enable=YES
ascii_upload_enable=YES
chmod_enable=YES
local_root=/var/ftp/html
chroot_list_enable=YES
chroot_local_user=YES
chroot_list_file=/etc/csftpd/vsftpd.chroot_list
pam_service_name=vsftpd
connect_from_port_20=NO
ftp_data_port=20
dirlist_enable=YES
dirmessage_enable=YES
message_file=.message
download_enable=YES
force_dot_files=YES
hide_ids=YES
local_enable=YES
ls_recurse_enable=NO
pasv_enable=YES
pasv_min_port=33201
pasv_max_port=33210
setproctitle_enable=YES
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd/vsftpd.user_list
write_enable=YES
xferlog_enable=YES
xferlog_std_format=YES
data_connection_timeout=300
idle_session_timeout=600
accept_timeout=60
file_open_mode=0460
max_clients=5
max_per_ip=2
[/code]

I started the service vsftpd and it works fine.
[code]
#sudo /sbin/service vsftpd start
[/code]

But when I access the ftp from client by typing in the hostname : 192.168.1.12, it does not connect.

I also edited the vsftpd.chroot and vsftpd.user_list files.

Any help would be appreciated. Thanks
Vik

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Installed vsftpd, ftp not running - need help for settings

Post by michaelnel » 2008/10/16 17:44:30

Is the iptables firewall running? ("service iptables status")?

If it is running is there an opening for ports 20 and 21?

Post the output of "service iptables status" here, please.

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: Installed vsftpd, ftp not running - need help for settings

Post by michaelnel » 2008/10/16 17:46:11

[quote]
vikram8jp wrote:
But when I access the ftp from client by typing in the hostname : 192.168.1.12, it does not connect.
Vik[/quote]

What are you typing this into?

vikram8jp
Posts: 9
Joined: 2008/10/15 04:16:18

Re: Installed vsftpd, ftp not running - need help for settings

Post by vikram8jp » 2008/10/17 01:32:55

Output of iptables:

[code]
Table: filter
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5901
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5902
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5903
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5904
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
[/code]

Yes you are right. Ports 20 and 21 are not open. silly of me. didn't know about this.
If I edit the following in /etc/sysconfig/iptables, would it open the ports 20 and 21.

[code]
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
[/code]

[quote]
Is the iptables firewall running? ("service iptables status")?

If it is running is there an opening for ports 20 and 21?

Post the output of "service iptables status" here, please.
[/quote]

Thanks a lot
Vik

vikram8jp
Posts: 9
Joined: 2008/10/15 04:16:18

Re: Installed vsftpd, ftp not running - need help for settings

Post by vikram8jp » 2008/10/17 01:36:30

I am typing this in the ftp built in command prompt.

It gives the error
[code]
c:>ftp 192.168.1.12
>ftp: connect :Unknown error number
[/code]

doesn't seem very descriptive this command prompt. I have turned to using FIlezilla now.

[quote]
michaelnel wrote:
[quote]
vikram8jp wrote:
But when I access the ftp from client by typing in the hostname : 192.168.1.12, it does not connect.
Vik[/quote]

What are you typing this into?[/quote]

vikram8jp
Posts: 9
Joined: 2008/10/15 04:16:18

Re: Installed vsftpd, ftp not running - need help for settings

Post by vikram8jp » 2008/10/17 01:45:21

Thanks a lot Michael.

I am able to connect to FTP with your directions.

Regards
Vik

Post Reply