PDA

View Full Version : ProFTP & SuSe 10


latcarf
9th March 2006, 02:50
I ran the SuSe10 HowTo, made the init.d/proftpd file, then copied my proftpd.conf from my FC4 machine to the SuSe machine. A restart got server1:~ # - Fatal: unknown configuration directive 'AuthPAMConfig' on line 16 of '/etc/proftpd.conf'.I commented the 2 PAM lines out and the restart went well. I then went to my NAT and reset the Vserver from the FC4 machine IP to the SuSe10 machine IP. Can't connect to the ftp site from the web.

I searched around for some possible answers first... I saw that I would probably need log files but I could not find any in /var/log ! Here is my conf though... # This is the ProFTPD configuration file
# $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $

ServerName "ProFTPD server"
ServerIdent on "FTP Server ready."
ServerAdmin root@localhost
ServerType standalone
DefaultServer on
AccessGrantMsg "User %u logged in."
DeferWelcome off

# Use this to excude users from the chroot
DefaultRoot ~ !adm

# Use pam to authenticate (default) and be authoritative
#AuthPAMConfig proftpd
#AuthOrder mod_auth_pam.c* mod_auth_unix.c

# Do not perform ident nor DNS lookups (hangs when the port is filtered)
IdentLookups off
UseReverseDNS off

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Default to show dot files in directory listings
ListOptions "-a"

# Allow to resume not only the downloads but the uploads too
AllowRetrieveRestart on
AllowStoreRestart on

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 20

# Set the user and group that the server normally runs at.
User ftp
Group ftp

# This is where we want to put the pid file
ScoreboardFile /var/run/proftpd.score

# Normally, we want users to do a few things.
<Global>
AllowOverwrite no
<Limit ALL SITE_CHMOD>
AllowAll
</Limit>
<Limit MKD DELE RNFR RNTO>
DenyAll
</Limit>
</Global>

# Define the log formats
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"

# anonymous configuration, with an upload directory.
<Anonymous ~ftp>
User ftp
Group ftp
AccessGrantMsg "Anonymous login ok, restrictions apply."
#
# # We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp

# # Limit the maximum number of anonymous logins
MaxClients 10 "Sorry, max %m users -- try again later"

# Put the user into /pub right after login
DefaultChdir /TheFarm

# We want 'welcome.msg' displayed at login, '.message' displayed in
# each newly chdired directory and tell users to read README* files.
DisplayLogin /welcome.msg

# Some more cosmetic and not vital stuff
# DirFakeUser on ftp
# DirFakeGroup on ftp

# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE SITE_CHMOD>
AllowAll
</Limit>

# An upload directory that allows storing files but not retrieving
# or creating directories.
<Directory /Plant&Harvest/*>
AllowOverwrite no
<Limit READ>
AllowAll
</Limit>
<Limit STOR>
AllowAll
</Limit>
</Directory>

# Logging for the anonymous transfers
ExtendedLog /var/log/proftpd/access.log WRITE,READ default
ExtendedLog /var/log/proftpd/auth.log AUTH auth

</Anonymous>Thoughts on what I did wrong?

Lance

falko
9th March 2006, 11:11
I then went to my NAT and reset the Vserver from the FC4 machine IP to the SuSe10 machine IP.What exactly do you mean with that?

Please post the output of netstat -tap

latcarf
10th March 2006, 00:49
What exactly do you mean with that?That is my router... I have the FTP port to 21 and the IP pointing to the box with the running FTP. To test the new setup on the other box I have to go in and change the IP over to the new box. I guess I could set up another port and use it to test the other box could'nt I?

Please post the output of netstat -tapHere is the netstat. I ran this before I posted and saw FTP open (or should that be proFTP?). Didn't think to post it after that, sorry.Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 4885/xinetd
tcp 0 0 *:cvspserver *:* LISTEN 4885/xinetd
tcp 0 0 *:pop3s *:* LISTEN 4885/xinetd
tcp 0 0 *:printer *:* LISTEN 4885/xinetd
tcp 0 0 *:time *:* LISTEN 4885/xinetd
tcp 0 0 *:smpnameres *:* LISTEN 4885/xinetd
tcp 0 0 *:sane-port *:* LISTEN 4885/xinetd
tcp 0 0 *:echo *:* LISTEN 4885/xinetd
tcp 0 0 *:5801 *:* LISTEN 4885/xinetd
tcp 0 0 *:rsync *:* LISTEN 4885/xinetd
tcp 0 0 *:5802 *:* LISTEN 4885/xinetd
tcp 0 0 *:netbios-ssn *:* LISTEN 5252/smbd
tcp 0 0 *:5803 *:* LISTEN 4885/xinetd
tcp 0 0 *:systat *:* LISTEN 4885/xinetd
tcp 0 0 *:vboxd *:* LISTEN 4885/xinetd
tcp 0 0 *:5901 *:* LISTEN 4885/xinetd
tcp 0 0 *:pop2 *:* LISTEN 4885/xinetd
tcp 0 0 *:daytime *:* LISTEN 4885/xinetd
tcp 0 0 *:5902 *:* LISTEN 4885/xinetd
tcp 0 0 *:pop3 *:* LISTEN 4885/xinetd
tcp 0 0 *:5903 *:* LISTEN 4885/xinetd
tcp 0 0 *:netstat *:* LISTEN 4885/xinetd
tcp 0 0 *:imap *:* LISTEN 4885/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 4573/portmap
tcp 0 0 *:chargen *:* LISTEN 4885/xinetd
tcp 0 0 *:ftp *:* LISTEN 4885/xinetd
tcp 0 0 server1:domain *:* LISTEN 4949/named
tcp 0 0 localhost:domain *:* LISTEN 4949/named
tcp 0 0 *:ipp *:* LISTEN 4964/cupsd
tcp 0 0 *:smtp *:* LISTEN 5018/master
tcp 0 0 localhost:953 *:* LISTEN 4949/named
tcp 0 0 *:microsoft-ds *:* LISTEN 5252/smbd
tcp 0 0 *:www-http *:* LISTEN 5382/httpd2-prefork
tcp 0 0 *:domain *:* LISTEN 4949/named
tcp 0 0 *:ssh *:* LISTEN 4784/sshd
tcp 0 0 *:smtp *:* LISTEN 5018/master
tcp 0 0 localhost:953 *:* LISTEN 4949/named
tcp 0 0 server1:www-http c5850-a2-1-6:slp-notify TIME_WAIT -
tcp 0 18980 server1:www-http c5850-a2-1-6:datacaptor ESTABLISHED 8119/httpd2-prefork
tcp 0 18980 server1:www-http c5850-a2-:gammafetchsvr ESTABLISHED 5655/httpd2-prefork

falko
10th March 2006, 11:08
That is my router... I have the FTP port to 21 and the IP pointing to the box with the running FTP. To test the new setup on the other box I have to go in and change the IP over to the new box. I guess I could set up another port and use it to test the other box could'nt I?
Should be ok if you switch the IP addresses.

Here is the netstat. I ran this before I posted and saw FTP open (or should that be proFTP?).Seems as if your FTP daemon is run by xinetd. Can you find an ftp related file in /etc/xinet.d?

latcarf
10th March 2006, 15:15
Should be ok if you switch the IP addresses.

Seems as if your FTP daemon is run by xinetd. Can you find an ftp related file in /etc/xinet.d?Yes, this is because the HowTo for SuSue10 has us create one. I'll paste it here so you don't have to wonder somewhere else to see it... #! /bin/sh
# Copyright (c) 2000-2001 SuSE GmbH Nuernberg, Germany.
# All rights reserved.
#
# Original author: Marius Tomaschewski <mt@suse.de>
#
# Slightly modified in 2003 for use with SuSE Linux 8.1,
# by http://www.learnlinux.co.uk/
#
# Slightly modified in 2005 for use with SuSE Linux 9.2,
# by Falko Timme
#
# /etc/init.d/proftpd
#
### BEGIN INIT INFO
# Provides: proftpd
# Required-Start: $network $remote_fs $syslog $named
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Starts ProFTPD server
### END INIT INFO

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_PROFTPD=yes # Modified by learnlinux.co.uk
test "$START_PROFTPD" = yes || exit 0 # Modified by learnlinux.co.uk

# Return values acc. to LSB for all commands but
# status (see below):
#
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running

proftpd_cfg="/etc/proftpd.conf"
proftpd_bin="/usr/local/sbin/proftpd"
proftpd_pid="/usr/local/var/proftpd.pid"

[ -r $proftpd_cfg ] || exit 6
[ -x $proftpd_bin ] || exit 5

# Source status functions
. /etc/rc.status

# First reset status of this service
rc_reset

case "$1" in
start)
echo -n "Starting ProFTPD Server: "
test -f /etc/shutmsg && rm -f /etc/shutmsg
/sbin/startproc $proftpd_bin
rc_status -v
;;

stop)
echo -n "Shutting down ProFTPD Server: "
test -x /usr/local/sbin/ftpshut && /usr/local/sbin/ftpshut now && sleep 1
/sbin/killproc -TERM $proftpd_bin
test -f /etc/shutmsg && rm -f /etc/shutmsg
rc_status -v
;;

restart)
## If first returns OK call the second, if first or
## second command fails, set echo return value.
$0 stop
$0 start
rc_status
;;

try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
rc_status
;;

reload|force-reload)
## Exclusive possibility: Some services must be stopped
## and started to force a new load of the configuration.
echo -n "Reload ProFTPD Server: "
/sbin/killproc -HUP $proftpd_bin
rc_status -v
;;

status)
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
echo -n "Checking for ProFTPD Server: "
checkproc $proftpd_bin
rc_status -v
;;

probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
[ $proftpd_cfg -nt $proftpd_pid ] && echo reload
;;

*)
echo "Usage: $0 {start|stop|status|restart|reload|try-restart|probe}"
exit 1
;;
esac

# Set an exit status.
rc_exit

falko
10th March 2006, 16:31
No, I don't mean /etc/init.d, I mean /etc/xinetd.d!

latcarf
10th March 2006, 16:51
No, I don't mean /etc/init.d, I mean /etc/xinetd.d!lol... if it were not for us newbs there would be no Linux humor! :rolleyes: Yes there is an xinetd.d file... #
# xinetd.conf
#
# Copyright (c) 1998-2001 SuSE GmbH Nuernberg, Germany.
# Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany.
#

defaults
{
log_type = FILE /var/log/xinetd.log
log_on_success = HOST EXIT DURATION
log_on_failure = HOST ATTEMPT
# only_from = localhost
instances = 30
cps = 50 10

#
# The specification of an interface is interesting, if we are on a firewall.
# For example, if you only want to provide services from an internal
# network interface, you may specify your internal interfaces IP-Address.
#
# interface = 127.0.0.1

}

includedir /etc/xinetd.dI also noticed a vsftpd.conf file, could proftp and vsftp be conflicting with each other? Seems in the HowTo for FC4 we removed vsftp but I don't recall that being in the HowTo for SuSe10. vsftpd.conf ---># Example config file /etc/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.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# 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.

# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
#write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# 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
#
# You may fully customise the login banner string:
#
#ftpd_banner="Welcome to FOOBAR FTP service."
#
# 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
#
# 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
#
# If enabled, all user and group information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES

# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
#local_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 to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# 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
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200


# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
anon_world_readable_only=YES
#
# 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
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=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
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200


# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
#log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
#xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
#xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
#dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES

# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=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
#
# 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
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
#pasv_enable=NO

# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd

# Set listen=YES if you want vsftpd to run standalone
#
# listen=YES

falko
10th March 2006, 19:51
Now you posted /etc/xinetd.conf, but I want you to have a look in the /etc/xinetd.d directory for some FTP related file.
My guess is that there's another FTP running (controlled by xinetd); it can't be ProFTPd because in /etc/proftpd.conf it says that ProFTPd is run standalone.

latcarf
10th March 2006, 23:42
Now you posted /etc/xinetd.conf, but I want you to have a look in the /etc/xinetd.d directory for some FTP related file.
My guess is that there's another FTP running (controlled by xinetd); it can't be ProFTPd because in /etc/proftpd.conf it says that ProFTPd is run standalone.oops! well... now I am in Michigan for the weekend and won't be able to access the box until Sunday evening. :( In SuSe10, Yast, Network Services there is a program called "FFTP" (has a shoe for an icon) but I thought I turned it off.

How would I post a directory? screen shot?

falko
11th March 2006, 11:47
How would I post a directory? screen shot?
No, I don't want you to post a directory, I want you to have a look into that directory and see if there's some FTP related file. If you find one, post its contents here.

If you're in doubt, please post the output of ls -la /etc/xinetd.d/

latcarf
12th March 2006, 19:04
No, I don't want you to post a directory, I want you to have a look into that directory and see if there's some FTP related file. If you find one, post its contents here.

If you're in doubt, please post the output of ls -la /etc/xinetd.d/I am away for the weekend but I will take a look tonight when I get home. :)

latcarf
13th March 2006, 01:47
Okay in /etc/xinetd.d/ I found 2 files that are clearly FTP...

tftp# default: off
# description: tftp service is provided primarily for booting or when a \
# router need an upgrade. Most sites run this only on machines acting as
# "boot servers".
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = yes
}

and vsftp# default: off
# description:
# The vsftpd FTP server serves FTP connections. It uses
# normal, unencrypted usernames and passwords for authentication.
# vsftpd is designed to be secure.
#
# NOTE: This file contains the configuration for xinetd to start vsftpd.
# the configuration file for vsftp itself is in /etc/vsftpd.conf
service ftp
{
# server_args =
# log_on_success += DURATION USERID
# log_on_failure += USERID
# nice = 10
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/vsftpd
}and the output of ls -la /etc/xinetd.d/drwxr-xr-x 2 root root 704 Feb 27 20:13 .
drwxr-xr-x 105 root root 9088 Mar 12 18:36 ..
-rw-r--r-- 1 root root 228 Feb 27 20:10 chargen
-rw-r--r-- 1 root root 248 Feb 27 20:10 chargen-udp
-rw-r--r-- 1 root root 260 Feb 27 20:10 cups-lpd
-rw-r--r-- 1 root root 376 Feb 27 20:10 cvs
-rw-r--r-- 1 root root 228 Feb 27 20:10 daytime
-rw-r--r-- 1 root root 248 Feb 27 20:10 daytime-udp
-rw-r--r-- 1 root root 220 Feb 27 20:10 echo
-rw-r--r-- 1 root root 239 Feb 27 20:10 echo-udp
-rw-r--r-- 1 root root 404 Feb 27 20:10 fam
-rw-r--r-- 1 root root 167 Feb 27 20:10 i4l-vbox
-rw-r--r-- 1 root root 985 Feb 27 20:10 imap
-rw-r--r-- 1 root root 364 Feb 27 20:10 nagios-nrpe
-rw-r--r-- 1 root root 480 Feb 27 20:10 netstat
-rw-r--r-- 1 root root 216 Feb 27 20:10 qpopper
-rw-r--r-- 1 root root 234 Feb 27 20:10 rsync
-rw-r--r-- 1 root root 338 Feb 27 20:10 sane-port
-rw-r--r-- 1 root root 237 Feb 27 20:10 servers
-rw-r--r-- 1 root root 239 Feb 27 20:10 services
-rw-r--r-- 1 root root 111 Feb 27 20:13 smb
-rw-r--r-- 1 root root 248 Feb 27 20:10 swat
-rw-r--r-- 1 root root 462 Feb 27 20:10 systat
-rw-r--r-- 1 root root 387 Mar 8 18:51 tftp
-rw-r--r-- 1 root root 254 Feb 27 20:10 time
-rw-r--r-- 1 root root 248 Feb 27 20:10 time-udp
-rw-r--r-- 1 root root 2400 Feb 27 20:10 vnc
-rw-r--r-- 1 root root 653 Feb 27 20:10 vsftpd

falko
13th March 2006, 12:54
Put disable = yes into /etc/xinetd.d/vsftp:

# default: off
# description:
# The vsftpd FTP server serves FTP connections. It uses
# normal, unencrypted usernames and passwords for authentication.
# vsftpd is designed to be secure.
#
# NOTE: This file contains the configuration for xinetd to start vsftpd.
# the configuration file for vsftp itself is in /etc/vsftpd.conf
service ftp
{
# server_args =
# log_on_success += DURATION USERID
# log_on_failure += USERID
# nice = 10
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/vsftpd
disable = yes
}
and restart xinetd: /etc/init.d/xinetd restart
Then restart ProFTPd: /etc/init.d/proftpd restart

latcarf
14th March 2006, 00:26
Put disable = yes into /etc/xinetd.d/vsftp:

# default: off
# description:
# The vsftpd FTP server serves FTP connections. It uses
# normal, unencrypted usernames and passwords for authentication.
# vsftpd is designed to be secure.
#
# NOTE: This file contains the configuration for xinetd to start vsftpd.
# the configuration file for vsftp itself is in /etc/vsftpd.conf
service ftp
{
# server_args =
# log_on_success += DURATION USERID
# log_on_failure += USERID
# nice = 10
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/vsftpd
disable = yes
}
and restart xinetd: /etc/init.d/xinetd restart
Then restart ProFTPd: /etc/init.d/proftpd restart
I did this and still can't go to the site. I have looked at everything again and just cannot seem to find the missing link.

One thing I noticed that is different is that in FC4 the ftp directory was in /var, in SuSe10 it is in /srv. Maybe using my FC4 proftpd.conf is conflicting with this but I cannot see how since /etc/init.d/proftpd is pointing to /etc/proftpd.conf.

In SuSe the log files are not in /var/log but I guess they won't generate until I can actually get to the site and log in, is that correct?

falko
14th March 2006, 01:02
What does netstat -tap show?



In SuSe the log files are not in /var/log but I guess they won't generate until I can actually get to the site and log in, is that correct?
That's right.

latcarf
14th March 2006, 01:31
What does netstat -tap show?Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 18733/xinetd
tcp 0 0 *:cvspserver *:* LISTEN 18733/xinetd
tcp 0 0 *:pop3s *:* LISTEN 18733/xinetd
tcp 0 0 *:printer *:* LISTEN 18733/xinetd
tcp 0 0 *:time *:* LISTEN 18733/xinetd
tcp 0 0 *:smpnameres *:* LISTEN 18733/xinetd
tcp 0 0 *:sane-port *:* LISTEN 18733/xinetd
tcp 0 0 *:echo *:* LISTEN 18733/xinetd
tcp 0 0 *:5801 *:* LISTEN 18733/xinetd
tcp 0 0 *:rsync *:* LISTEN 18733/xinetd
tcp 0 0 *:5802 *:* LISTEN 18733/xinetd
tcp 0 0 *:5803 *:* LISTEN 18733/xinetd
tcp 0 0 *:systat *:* LISTEN 18733/xinetd
tcp 0 0 *:netbios-ssn *:* LISTEN 5346/smbd
tcp 0 0 *:vboxd *:* LISTEN 18733/xinetd
tcp 0 0 *:5901 *:* LISTEN 18733/xinetd
tcp 0 0 *:pop2 *:* LISTEN 18733/xinetd
tcp 0 0 *:daytime *:* LISTEN 18733/xinetd
tcp 0 0 *:5902 *:* LISTEN 18733/xinetd
tcp 0 0 *:pop3 *:* LISTEN 18733/xinetd
tcp 0 0 *:5903 *:* LISTEN 18733/xinetd
tcp 0 0 *:netstat *:* LISTEN 18733/xinetd
tcp 0 0 *:imap *:* LISTEN 18733/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 4674/portmap
tcp 0 0 *:chargen *:* LISTEN 18733/xinetd
tcp 0 0 *:ftp *:* LISTEN 20567/proftpd: (acc
tcp 0 0 server1:domain *:* LISTEN 4926/named
tcp 0 0 localhost:domain *:* LISTEN 4926/named
tcp 0 0 *:ipp *:* LISTEN 4933/cupsd
tcp 0 0 *:smtp *:* LISTEN 5084/master
tcp 0 0 localhost:953 *:* LISTEN 4926/named
tcp 0 0 *:microsoft-ds *:* LISTEN 5346/smbd
tcp 0 0 *:www-http *:* LISTEN 5455/httpd2-prefork
tcp 0 0 *:domain *:* LISTEN 4926/named
tcp 0 0 *:ssh *:* LISTEN 4907/sshd
tcp 0 0 *:smtp *:* LISTEN 5084/master
tcp 0 0 localhost:953 *:* LISTEN 4926/namedIf I am reading this right it shows it running...

I have my router set to the SuSe box which is 192.168.2.3 21:21 but the ftp site is still currently running off the FC4 box 192.168.2.5. As soon as I go into the FC4 box and run service proftpd stop and try to go to the ftp site I get "the connection refused" message. Same process I went though with www until I finally got it configured correctly.

falko
14th March 2006, 10:46
Yes, ProFTPd is running.

Please check your router settings again. Maybe you must restart it.

latcarf
14th March 2006, 12:36
Yes, ProFTPd is running.

Please check your router settings again. Maybe you must restart it.I have tried that without success... however, I believe I have found the problem. In SuSe Yast, Security and Users, Firewall there is an "Allowed Services" section. The only services that appear to be allowed are HTTP and Samba. When I click the Services to Allow list to add another service proftpd (or vsftpd) are not listed, only tftp. Seems all I have to do is figure out how to add proftpd or set the firewall outside of Yast. maybe....

falko
14th March 2006, 19:30
In SuSe Yast, Security and Users, Firewall there is an "Allowed Services" section. The only services that appear to be allowed are HTTP and Samba. When I click the Services to Allow list to add another service proftpd (or vsftpd) are not listed, only tftp. Seems all I have to do is figure out how to add proftpd or set the firewall outside of Yast. Sounds reasonable. :)

latcarf
21st March 2006, 02:43
I never could get proftpd to work and hosed SuSe YaST in the process. I did a fresh load of SuSe and decided to try vsftpd since it comes with the distro.

I had some issues which I attribute to being a newb :D I have one last problem I cannot seem to figure out... I can connect via Konsole and Internet, no problem. I cannot transfer (write) to the site, problem. I think I have the conf correct but here it is, anyone see anything wrong?# Example config file /etc/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.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# 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.

# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# 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
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to The Fractal Farm FTP service."
#
# 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
#
# 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
#
# If enabled, all user and group information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES


# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_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 to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# 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
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200


# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
anon_world_readable_only=YES
#
# 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
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=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
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200


# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
#log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
#xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
#xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
#dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES


# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=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
#
# 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
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
pasv_enable=YES
#
# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd
#
# Set listen=YES if you want vsftpd to run standalone
#
listen=YES I checked folder permissions and Groups and Users have permssions to View and Modify with only the Owner allowed to rename and delete.

Here is netstat -tap just in case...Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:printer *:* LISTEN 29569/xinetd
tcp 0 0 *:time *:* LISTEN 29569/xinetd
tcp 0 0 *:smpnameres *:* LISTEN 29569/xinetd
tcp 0 0 *:sane-port *:* LISTEN 29569/xinetd
tcp 0 0 *:echo *:* LISTEN 29569/xinetd
tcp 0 0 *:5801 *:* LISTEN 29569/xinetd
tcp 0 0 *:rsync *:* LISTEN 29569/xinetd
tcp 0 0 *:5802 *:* LISTEN 29569/xinetd
tcp 0 0 *:5803 *:* LISTEN 29569/xinetd
tcp 0 0 *:systat *:* LISTEN 29569/xinetd
tcp 0 0 *:netbios-ssn *:* LISTEN 26746/smbd
tcp 0 0 *:5901 *:* LISTEN 29569/xinetd
tcp 0 0 *:daytime *:* LISTEN 29569/xinetd
tcp 0 0 *:5902 *:* LISTEN 29569/xinetd
tcp 0 0 *:5903 *:* LISTEN 29569/xinetd
tcp 0 0 *:netstat *:* LISTEN 29569/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 8013/portmap
tcp 0 0 *:chargen *:* LISTEN 29569/xinetd
tcp 0 0 *:ftp *:* LISTEN 27830/vsftpd
tcp 0 0 *:ipp *:* LISTEN 20511/cupsd
tcp 0 0 localhost:smtp *:* LISTEN 8209/master
tcp 0 0 *:microsoft-ds *:* LISTEN 26746/smbd
tcp 0 0 *:www-http *:* LISTEN 19489/httpd2-prefor
tcp 0 0 *:ssh *:* LISTEN 8308/sshd
tcp 0 0 localhost:smtp *:* LISTEN 8209/master
I always get this when I restart vsftpd and did some searching but really didn't see where it was a problem but I dont have enough experience yet to say it is not the problem server1:~ # /usr/sbin/vsftpd &
500 OOPS: could not bind listening IPv4 socket
[1] 885
[1] Exit 1 /usr/sbin/vsftpd
server1:~ #Better yet... is "&" Start or Restart, and what is Stop!?

(Up to now I have used Gnome but majority seems to think KDE is better so I went with it when I reloaded SuSe)

falko
21st March 2006, 19:03
Please put

local_umask=022
chroot_local_user=YES into /etc/vsftpd.conf and restart vsftpd:
/etc/init./vsftpd restart

I always get this when I restart vsftpd and did some searching but really didn't see where it was a problem but I dont have enough experience yet to say it is not the problem server1:~ # /usr/sbin/vsftpd &
500 OOPS: could not bind listening IPv4 socket
[1] 885
[1] Exit 1 /usr/sbin/vsftpd
server1:~ #Better yet... is "&" Start or Restart, and what is Stop!?

(Up to now I have used Gnome but majority seems to think KDE is better so I went with it when I reloaded SuSe)Please use the vsftpd init script in /etc/init.d to start/stop/restart vsftpd.

latcarf
22nd March 2006, 02:40
Please put

local_umask=022
chroot_local_user=YES into /etc/vsftpd.conf and restart vsftpd:
/etc/init./vsftpd restart

Please use the vsftpd init script in /etc/init.d to start/stop/restart vsftpd.I changed the config file as you asked. The problem is I do not have a /etc/init./vsftpd file! A search for "vsftpd" got this file:///etc/logrotate.d/vsftpd
file:///etc/pam.d/vsftpd
file:///etc/xinetd.d/vsftpd
file:///usr/sbin/vsftpd Indicates this is an Executable file
file:///usr/share/doc/packages/vsftpd
The intersting thing is that in file:///usr/share/doc/packages/vsftpd I read that I do not need inted or xinted. There are various configs available so I selected the one I need (standalone), followed the instructions and it worked, almost. I still could not do an anonymous upload so I went back and changed the Write lines from NO to YES.
The second issue came in then, Stop, Start, and Restart are not being recognized by Konsole. This is the responses I getserver1:~ # vsftpd stop
500 OOPS: vsftpd: cannot open config file:stop
server1:~ # vsftpd start
500 OOPS: vsftpd: cannot open config file:start
server1:~ # vsftpd restart
500 OOPS: vsftpd: cannot open config file:restart
server1:~ # vsftpd &
[1] 6542
500 OOPS: could not bind listening IPv4 socket
server1:~ # All the documentation I find points to using "&" to start the service but I am beginning to think this is not used to Stop or Restart the service. I am beginning to think that "&" is for start only and I keep getting[B]500 OOPS: could not bind listening IPv4 socket because it is already running and I need to restart it for changes to take effect. I have Googled myself silly trying to find "&" and what stop and restart might be but I am having no luck :(

falko
22nd March 2006, 18:28
It seems your vsftpd was run by xinetd, so you should have restarted xinetd.

But now that you want to run it with an init script, you should check if /etc/init.d/vsftpd uses the correct config file (I guess it looks for /etc/vsftpd.conf instead of /etc/vsftpd/vsftpd.conf).

You can kill the running vsftpd process with

kill -9 27830

latcarf
23rd March 2006, 03:26
It seems your vsftpd was run by xinetd, so you should have restarted xinetd.

But now that you want to run it with an init script, you should check if /etc/init.d/vsftpd uses the correct config file (I guess it looks for /etc/vsftpd.conf instead of /etc/vsftpd/vsftpd.conf).

You can kill the running vsftpd process with

kill -9 27830Ya Hoo! :D I finally got it up and running!!

It was not running in xinted (I disabled that 2 days ago) and for some reason it never existed in init. :confused:

The kill command was the key. vsftpd & was not stoping or restarting the service. After initial use if I changed the config file and run it again it would just return 500 OOPS: could not bind listening IPv4 socket because it was already running.

I finally found /usr/share/doc/packages/vsftpd and there was a folder called EXAMPLES. It gives several set-ups with the config files. I used INTERNET_SITE_NOINETD, changed a couple setting to YES and that did it!

I need to figure out why commands (Start, Stop, Restart, nmap) don't seem to be working in my Konsole. Or is that a Gnome thing? I went KDE this time and while I like it better so far there are differences I am still adjusting too.

thanks for the help falco!

falko
23rd March 2006, 09:51
I need to figure out why commands (Start, Stop, Restart, nmap) don't seem to be working in my Konsole. Or is that a Gnome thing?
It has nothing to do with your desktop.
Maybe the init script wasn't made for SuSE. Might be worth a try to switch vsftpd back to xinetd.

latcarf
24th March 2006, 00:02
It has nothing to do with your desktop.
Maybe the init script wasn't made for SuSE.That makes sense and is something I will research. If I find an answer I will post it here so others can will have an answer if they run into the same problem. I also had a thought last night (and it didn't even hurt!) after I posted, I have only seen "&" in the vsftpd documentation so it must be something basically exclusive to vsftpd. Might be worth a try to switch vsftpd back to xinetd. :eek: lol! no way!! its working the way I need it now... just a simple anonymous site for people to upload and download files for fractal programs.

latcarf
28th March 2006, 04:23
as promised... what I learned! For some reason when the vsftpd rpm package supplied with SuSe 10 is installed it does not automatically create an init.d vsftpd script. After searching, trying, succeeding these are the steps to accomplish this on your own...

1. vim or kwrite /etc/init.d/vsftpd (we are creating this as a new file)
2. Copy and paste this into the file, then save and close:#!/bin/sh
case "$1" in
start)
echo "Starting vsftpd ..."
/usr/sbin/vsftpd &
;;
stop)
echo "Stopping vsftpd ..."
killall vsftpd
;;
*)
echo "Usage: 'basename $0' {start|stop}" >&2
exit 64
;;
esac
exit 0
3. From terminal run:chmod +x /etc/init.d/vsftpd
4. Open YaST, System, System Services (Runlevel).
5. Select Expert Mode.
6. Scroll down to vsftpd, highlight it and select the 3 and 5 runlevels, then Finish.
7. Restart machine, from terminal run ps aux | grep vsftpYou should see something to the effect of server1:~ # ps aux | grep vsftp
root 3639 0.0 0.2 1828 536 ? S 19:54 0:00 /usr/sbin/vsftpd
root 3642 0.0 0.1 1520 448 ? Ss 19:54 0:00 startpar -f -- vsftpd
root 6005 0.0 0.2 1828 604 pts/1 R+ 20:19 0:00 grep vsftp
server1:~ # (note if run as user the last line will more than likely start with user name, shown as root above.)

Hope this helps others in the future. :)