LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   pure-ftpd virtual user issue (https://www.linuxquestions.org/questions/linux-server-73/pure-ftpd-virtual-user-issue-4175463928/)

mbnoimi 05-29-2013 06:19 AM

pure-ftpd virtual user issue
 
All virtual users of pure-ftpd can't login although I configured them without any error message!

Login error message:
Code:

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 10 allowed.
220-Local time is now 13:01. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 5 minutes of inactivity.
      USER test
331 User test OK. Password required
      PASS (password not shown)
530 Login authentication failed

Here's pure-ftpd configurations:
Code:

mbnoimi-pc conf # apt-get install pure-ftpd
mbnoimi-pc conf # cd /etc/pure-ftpd/conf/
mbnoimi-pc conf # echo yes > ChrootEveryone
mbnoimi-pc conf # echo yes > CreateHomeDir
mbnoimi-pc conf # echo 10 > MaxClientsNumber
mbnoimi-pc conf # echo 3 > MaxClientsPerIP
mbnoimi-pc conf # echo yes > NoAnonymous
mbnoimi-pc conf # echo no > DisplayDotFiles
mbnoimi-pc conf # echo yes > DontResolve
mbnoimi-pc conf # echo 5 > MaxIdleTime
mbnoimi-pc conf # echo yes > PAMAuthentication
mbnoimi-pc conf # echo no > AnonymousCanCreateDirs
mbnoimi-pc conf # echo 007 007 > Umask
mbnoimi-pc conf # echo yes > ProhibitDotFilesWrite
mbnoimi-pc conf # echo yes > ProhibitDotFilesRead
mbnoimi-pc conf # echo no > AutoRename
mbnoimi-pc conf # echo yes > NoChmod
mbnoimi-pc conf # echo no > KeepAllFiles
mbnoimi-pc conf # echo 0 > TLS
mbnoimi-pc conf # /etc/init.d/pure-ftpd restart
Restarting ftp server: Running: /usr/sbin/pure-ftpd -l pam -j -x -X -C 3 -Y 0 -H -I 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
mbnoimi-pc pure-ftpd # ls auth/
65unix  70pam
mbnoimi-pc pure-ftpd # cat auth/65unix
no
mbnoimi-pc pure-ftpd # cat auth/70pam
yes
mbnoimi-pc pure-ftpd # cat pureftpd.passwd
test:$1$O1zF99b0$oH7S4lxScfwMoPpyvBywr.:119:130::/home/ftpusers/./::::::::::::
mbnoimi-pc pure-ftpd #

http://imageshack.us/a/img24/5412/pureadminusers001.png

mbnoimi 06-01-2013 09:16 PM

Bump

bathory 06-02-2013 01:34 AM

Hi,

There is no "-lpuredb:/etc/pureftpd.pdb" among the other runtime options.
As this looks like a debian box, have a look at this howto for details

Regards

mbnoimi 06-02-2013 02:01 AM

Quote:

There is no "-lpuredb:/etc/pureftpd.pdb" among the other runtime options.
How can I add it?
I tried to add it through but nothing changed!
Code:

mbnoimi@mbnoimi-pc ~ $ sudo pure-pw mkdb
mbnoimi@mbnoimi-pc ~ $ sudo pure-pw list
test                /home/ftpusers/./     
mbnoimi@mbnoimi-pc ~ $ ls -R /etc/pure-ftpd/
/etc/pure-ftpd/:
auth  conf  db  pureftpd-dir-aliases  pureftpd.passwd  pureftpd.pdb

/etc/pure-ftpd/auth:
65unix  70pam

/etc/pure-ftpd/conf:
AltLog                  AutoRename      CreateHomeDir    DontResolve  KeepAllFiles      MaxClientsPerIP  MinUID      NoChmod            ProhibitDotFilesRead  PureDB  Umask
AnonymousCanCreateDirs  ChrootEveryone  DisplayDotFiles  FSCharset    MaxClientsNumber  MaxIdleTime      NoAnonymous  PAMAuthentication  ProhibitDotFilesWrite  TLS    UnixAuthentication


mbnoimi 06-02-2013 02:24 AM

Quote:

Originally Posted by bathory (Post 4963873)
have a look at this howto for details

I took a look and applied what it says but I got nothing!!!
Code:

mbnoimi-pc mbnoimi # pure-pw useradd test1 -u ftpuser -d /home/ftpusers/test1
Password:
Enter it again:
mbnoimi-pc mbnoimi # pure-pw show test1

Login              : test1
Password          : $1$EI7InKU0$XF83gt49Z9F4QLtfryxai0
UID                : 119 (ftpuser)
GID                : 130 (ftpgroup)
Directory          : /home/ftpusers/test1/./
Full name          :
Download bandwidth : 0 Kb (unlimited)
Upload  bandwidth : 0 Kb (unlimited)
Max files          : 0 (unlimited)
Max size          : 0 Mb (unlimited)
Ratio              : 0:0 (unlimited:unlimited)
Allowed local  IPs :
Denied  local  IPs :
Allowed client IPs :
Denied  client IPs :
Time restrictions  : 0000-0000 (unlimited)
Max sim sessions  : 0 (unlimited)

mbnoimi-pc mbnoimi # ls -R /home/ftpusers/
/home/ftpusers/:
mbnoimi-pc mbnoimi #

PS
I want to use virtual users

bathory 06-02-2013 02:52 AM

I'm not running Debian, but according to the howto, you need to disable PAM and (maybe) Unix auth
Also you have to create a symlink
Code:

#cd /etc/pure-ftpd/auth
#ln -s ../conf/PureDB 50pure


mbnoimi 06-02-2013 03:02 AM

Quote:

Originally Posted by bathory (Post 4963904)
I'm not running Debian, but according to the howto, you need to disable PAM and (maybe) Unix auth
Also you have to create a symlink
Code:

#cd /etc/pure-ftpd/auth
#ln -s ../conf/PureDB 50pure


Didn't fix the issue :(

bathory 06-02-2013 08:08 AM

Quote:

Originally Posted by mbnoimi (Post 4963908)
Didn't fix the issue :(

Doh.
Try to run it directly from CLI:
Code:

/usr/sbin/pure-ftpd -l -j -x -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
and see what you get

mbnoimi 06-02-2013 03:42 PM

Code:

mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -l -j -x -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
421 Unknown authentication method: -j
mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -l -x -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
421 Unknown authentication method: -x
mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -l -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
421 Unknown authentication method: -X
mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -l -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
421 Unknown authentication method: -C
mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -l -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B
421 Unknown authentication method: -Y
mbnoimi-pc mbnoimi #


bathory 06-03-2013 12:15 AM

My bad. I left an extra -l, sorry
Code:

/usr/sbin/pure-ftpd -j -x -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B

mbnoimi 06-03-2013 12:33 AM

Quote:

Originally Posted by bathory (Post 4964385)
My bad. I left an extra -l, sorry
Code:

/usr/sbin/pure-ftpd -j -x -X -C 3 -Y 0 -H -Ipuredb:/etc/pureftpd.pdb 5 -R -E -u 1000 -U 007:007 -A -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -c 10 -B

Didn't fix the issue!
Code:

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 10 allowed.
220-Local time is now 07:32. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
      USER test
331 User test OK. Password required
      PASS (password not shown)
530 Login authentication failed


bathory 06-03-2013 01:32 AM

Where is pureftpd.pdb located? Note that you need to use that location in /etc/pure-ftpd/conf/PureDB
Also, are you sure about the user/password? Change it with:
Code:

pure-pw passwd test
pure-pw mkdb

and try to login again

You can also run the server with less options and in debug mode to check virtual users. Use the correct location of pureftpd.pdb below:
Code:

/usr/sbin/pure-ftpd -I puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R -d

mbnoimi 06-03-2013 01:48 AM

Quote:

Where is pureftpd.pdb located? Note that you need to use that location in /etc/pure-ftpd/conf/PureDB
I post it above https://www.linuxquestions.org/quest...8/#post4963881

Quote:

Also, are you sure about the user/password? Change it with:
Yes I'm sure, Any way I change it as you suggested
Code:

mbnoimi-pc mbnoimi # pure-pw passwd test
Password:
Enter it again:
mbnoimi-pc mbnoimi # pure-pw mkdb

Quote:

You can also run the server with less options and in debug mode to check virtual users. Use the correct location of pureftpd.pdb below:
Code:

/usr/sbin/pure-ftpd -I puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R -d

This didn't work!
Code:

mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -I puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R -d
Unable to start a standalone server: Address already in use
mbnoimi-pc mbnoimi # /etc/init.d/pure-ftpd stop
Stopping ftp server: pure-ftpd.
mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -I puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R -d
Unable to start a standalone server: Address already in use
mbnoimi-pc mbnoimi #


bathory 06-03-2013 02:29 AM

That's what I saw and understood that we're using the wrong file

Quote:

Unable to start a standalone server: Address already in use
If you can't stop it, you can kill it

mbnoimi 06-03-2013 02:38 AM

Quote:

Originally Posted by bathory (Post 4964429)
If you can't stop it, you can kill it

OK I succefully killed it and run it (as shown below) then tried to login once again but nothing changes.
Code:

mbnoimi-pc mbnoimi # /usr/sbin/pure-ftpd -I puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R -d
^Cmbnoimi-pc mbnoimi #



All times are GMT -5. The time now is 10:24 PM.