LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-07-2012, 02:29 PM   #1
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Rep: Reputation: 0
Users can't connect via ftp [proftpd]


Hey all,

I'm currently trying to run a proftpd server.
The problem is, that users can't connect to it.

I've added the user without SSH access
Code:
useradd ftpuser -d /home/ftpuser -s /bin/false
Code:
passwd ftpuser
I have jailed the user to it's home directory (Default ~) was uncomented in proftpd.conf

I added the following:

#VALID USERS
<Limit LOGIN>
AllowUser ftpuser
DenyALL
</Limit>

And the user doesn't exist in /etc/ftpusers (I also tried with adding the user there).

And here's what I get when trying to connect:

Code:
Response:	220 ProFTPD 1.3.3a Server (xxxx) [xxx.xxx.xxx.xxx]
Command:	USER ftpuser
Response:	331 Password required for ftpuser
Command:	PASS *******
Response:	530 Login incorrect.
Error:	Critical error
Error:	Could not connect to server
So are there any suggestions on this issue?

Last edited by ps1x0; 12-07-2012 at 05:18 PM.
 
Old 12-07-2012, 02:46 PM   #2
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
You might have in the proftp configuration something like only users with valid shell can login and as your ftpuser has /bin/false, wont be allowed to login.

Maybe adding the full config of proftp would help.
 
Old 12-07-2012, 03:03 PM   #3
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Most of the things are default.

So yes. That's the problem (as I suspected).

Code:
Dec 07 22:23:16 gs-server-3 proftpd[14427] DNS-name-here (DNS-name-here[xx.xx.xxx.xx]): USER ftpuser (Login failed): Invalid shell: '/bin/false'
Dec 07 22:23:16 gs-server-3 proftpd[14427] DNS-name-here (DNS-name-here[xx.xx.xxx.xx]): FTP session closed.
How do I fix that?

Code:
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
# 

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6                         off
# If set on you can experience a longer connection delay in many cases.
IdentLookups                    off

ServerName                      "xxxxxxxxxxxxxxxxx"
ServerType                      standalone
DeferWelcome                    off

MultilineRFC2228                on
DefaultServer                   on
ShowSymlinks                    on

TimeoutNoTransfer               600
TimeoutStalled                  600
TimeoutIdle                     1200

DisplayLogin                    welcome.msg
DisplayChdir                    .message true
ListOptions                     "-l"

DenyFilter                      \*.*/

# Use this to jail all users in their homes 
DefaultRoot                     ~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
# RequireValidShell             off

# Port 21 is the standard FTP port.
Port                            21

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                  49152 65534

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress             1.2.3.4

# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

# 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                    8

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

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask                           022  022
# Normally, we want files to be overwriteable.
AllowOverwrite                  on

# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd              off

MaxClients 8
MaxClientsPerHost 8
MaxClientsPerUser 1
MaxHostsPerUser 1

# This is required to use both PAM-based authentication and local passwords
# AuthOrder                     mod_auth_pam.c* mod_auth_unix.c

# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile                   off

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default. 
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf

#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.con

#VALID USERS
<Limit LOGIN>
AllowUser ftpuser
</Limit>

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
#   User                                ftp
#   Group                               nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias                   anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser on ftp
#   DirFakeGroup on ftp
# 
#   RequireValidShell           off
# 
#   # Limit the maximum number of anonymous logins
#   MaxClients                  10
# 
#   # We want 'welcome.msg' displayed at login, and '.message' displayed
#   # in each newly chdired directory.
#   DisplayLogin                        welcome.msg
#   DisplayChdir                .message
# 
#   # Limit WRITE everywhere in the anonymous chroot
#   <Directory *>
#     <Limit WRITE>
#       DenyAll
#     </Limit>
#   </Directory>
# 
#   # Uncomment this if you're brave.
#   # <Directory incoming>
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask                           022  022
#   #            <Limit READ WRITE>
#   #            DenyAll
#   #            </Limit>
#   #            <Limit STOR>
#   #            AllowAll
#   #            </Limit>
#   # </Directory>
# 
# </Anonymous>

Last edited by ps1x0; 12-07-2012 at 03:05 PM.
 
Old 12-07-2012, 04:25 PM   #4
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Well change the login shell to /bin/sh or /bin/bash and see if it works. If it works check then /etc/proftpd/modules.conf could be there the issue. In the config which you posted there is nothing wrong, but can't see /etc/proftpd/modules.conf so don't know.
 
Old 12-07-2012, 04:34 PM   #5
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by robertjinx View Post
Well change the login shell to /bin/sh or /bin/bash and see if it works. If it works check then /etc/proftpd/modules.conf could be there the issue. In the config which you posted there is nothing wrong, but can't see /etc/proftpd/modules.conf so don't know.
Users who have SSH access can login, but that's the idea. I don't want the FTP users to have SSH.
 
Old 12-07-2012, 04:49 PM   #6
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Yes I know, but for that you need to make sure that proftp allows that.

You need to add "RequireValidShell on" to your proftpd.conf

---------- Post added 12-07-12 at 23:50 ----------

Sorry: "RequireValidShell no" and restart proftp.
 
Old 12-07-2012, 05:18 PM   #7
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by robertjinx View Post
Yes I know, but for that you need to make sure that proftp allows that.

You need to add "RequireValidShell on" to your proftpd.conf

---------- Post added 12-07-12 at 23:50 ----------

Sorry: "RequireValidShell no" and restart proftp.
That solved it. Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Proftpd won't allow users to gain access to anonymous FTP j.smith1981 Linux - Security 2 11-10-2012 02:04 AM
[SOLVED] can't connect to ftp site via proftpd Majed17 Linux - Software 3 07-17-2012 07:52 AM
Help on setting up multiple FTP users on Ubuntu Server 9.04 with proFTPD Jamie Kugelmann Linux - Server 1 12-23-2009 02:31 AM
ProFTPd ... FTP client fails to connect: timeout after client sends 'LIST' nutnut Linux - Software 2 01-01-2006 07:09 PM
FTP Server Up and running... how do I hide ftp users from local login screen? joe1031 Mandriva 2 03-18-2005 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration