Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

emerge -u world broke VSFTPd (Urgent!)

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
23 posts • Page 1 of 1
Author
Message
zeroclip
n00b
n00b
Posts: 38
Joined: Fri Apr 02, 2004 10:01 pm

emerge -u world broke VSFTPd (Urgent!)

  • Quote

Post by zeroclip » Wed Mar 02, 2005 9:53 pm

Hi.

I did a emerge sync && emerge -u world today. and vsftpd stopped working. When i do a connect to the site i get this:
---> FEAT
<--- 211-Features:
<--- AUTH SSL
<--- AUTH TLS
<--- EPRT
<--- EPSV
<--- MDTM
<--- PASV
<--- PBSZ
<--- PROT
<--- REST STREAM
<--- SIZE
<--- TVFS
<--- 211 End
---> AUTH TLS
<--- 234 Proceed with negotiation.
---> USER ggnet
Certificate depth: 0; subject: /C=NO/ST=Some-State/O=Internet Widgits Pty Ltd; issuer: /C=NO/ST=Some-State/O=Internet Widgits Pty Ltd
WARNING: Certificate verification: self signed certificate
<--- 331 Please specify the password.
---> PASS *****
**** SSL read: wrong version number
---- Closing control socket
ls: Fatal error: SSL read: wrong version number
Wait! there is more! without SSL i get this:
---> FEAT
<--- 211-Features:
<--- AUTH SSL
<--- AUTH TLS
<--- EPRT
<--- EPSV
<--- MDTM
<--- PASV
<--- PBSZ
<--- PROT
<--- REST STREAM
<--- SIZE
<--- TVFS
<--- 211 End
---> USER ggnet
<--- 331 Please specify the password.
---> PASS *****
<--- 500 OOPS: priv_sock_get_result
---> PWD
**** Peer closed connection
---- Closing control socket
ls: Login failed: 500 OOPS: priv_sock_get_result
Please tell me what i did! I've never seen the second error before. The First one is only a minor problem as most of my users do not use SSL.

Thanks!
Top
zeroclip
n00b
n00b
Posts: 38
Joined: Fri Apr 02, 2004 10:01 pm

Re: emerge -u world broke VSFTPd (Urgent!)

  • Quote

Post by zeroclip » Thu Mar 03, 2005 1:58 am

Hi again.

The problem is somehow releated to pam and pam_userdb.so. If i use system-auth instead of userdb it works fine. But i don't want all those virtual users in my local passwd. Please advise.
Top
Jylppy
n00b
n00b
User avatar
Posts: 17
Joined: Mon May 10, 2004 7:04 pm
Location: Finland

Same problem here

  • Quote

Post by Jylppy » Sun Mar 06, 2005 9:19 pm

Hello, I have the same problem. pam-0.78 update broke vsftpd virtual users' login. No solution found yet.

-J
Top
Norick
n00b
n00b
Posts: 31
Joined: Fri Sep 12, 2003 2:08 pm
Location: Prague

  • Quote

Post by Norick » Tue May 17, 2005 9:18 pm

I have same problem... Has anybody found solution yet?

Thanks
Top
bratwurst
n00b
n00b
Posts: 6
Joined: Tue May 24, 2005 10:58 pm
Location: Sweden

Same here....

  • Quote

Post by bratwurst » Tue May 24, 2005 11:54 pm

Tried to

Code: Select all

emerge unmerge db
emerge pam (installed db 4.2)
emerge db
Problem remains....
It's hard to debug, too since the logs don't really help

Tried to google...not much help

Anyone ???
Top
Jazz
Guru
Guru
User avatar
Posts: 543
Joined: Sun Nov 16, 2003 10:50 pm
Location: Melbourne, Australia

  • Quote

Post by Jazz » Sun Jun 05, 2005 6:37 pm

ok same problem here.. any ideas ?
thanx
In 2010, M$ Windows will be a quantum processing emulation layer for a 128-bit mod of a 64-bit hack of a 32-bit patch to a 16-bit GUI for an 8-bit operating system written for a 4-bit processor from a 2-bit company that can't stand 1 bit of competition.
Top
fdamstra
n00b
n00b
Posts: 39
Joined: Wed Feb 11, 2004 1:44 pm
Location: Grand Rapids, MI
Contact:
Contact fdamstra
Website

  • Quote

Post by fdamstra » Tue Jul 19, 2005 4:01 pm

Jazz wrote:ok same problem here.. any ideas ?
thanx
This hasn't been resolved? Eek... Ran into this problem today. All my virtual users are broken.

Does anybody know the cause?

Update:
I found this bug, and apparently people have been running into this for quite some time, though I'm still not sure what causes it. I followed the "solution" in comment 16, then unmerged db, and reemerged the specific versions of db and pam that the author had, and it is working again.

However, I'm not very happy running an outdated version of PAM. Does anybody have a fix for the newer versions?
Top
svf
n00b
n00b
Posts: 50
Joined: Tue Feb 01, 2005 12:22 am

  • Quote

Post by svf » Wed Jul 20, 2005 6:18 pm

heya...

im using the /etc/pam.d/vsftpd from the vsftpd-2.0.2 package and it works

i dont use virtual users.. but ran actually into the same ssl prob

Code: Select all

cat /etc/pam.d/vsftpd
#%PAM-1.0
# $Header: /var/cvsroot/gentoo-x86/net-ftp/vsftpd/files/vsftpd.pam,v 1.5 2005/06/07 23:04:57 uberlord Exp $
auth     required   pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth     required   pam_stack.so service=system-auth
auth     required   pam_shells.so
account  required   pam_stack.so service=system-auth
session  required   pam_stack.so service=system-auth
hth
uchafu!
Top
bdismay
n00b
n00b
Posts: 1
Joined: Wed Jul 20, 2005 10:38 pm
Location: USA

  • Quote

Post by bdismay » Wed Jul 20, 2005 10:46 pm

Not sure if this will help anyone, but I had troubles connecting to vsftpd after upgrading baselayout this morning. I do not use virtual users, but had set up system accounts for each user. Each user account had been specified the shell /bin/false. After upgrading baselayout the /etc/shells file was overwritten with a new one that did not have /bin/false as a valid shell. Adding /bin/false to /etc/shells fixed my problems.
Top
Raffi
l33t
l33t
User avatar
Posts: 731
Joined: Mon Mar 17, 2003 1:32 am
Location: Moscow, Id.

  • Quote

Post by Raffi » Fri Aug 05, 2005 4:47 pm

I've tried various things to fix this problem, but I can't seem to get virtual users working again.

Has anyone gotten virtual users working with vsftpd-2.0.3-r1 and pam-0.78-r2?
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Fri Aug 05, 2005 11:21 pm

Raffi wrote:Has anyone gotten virtual users working with vsftpd-2.0.3-r1 and pam-0.78-r2?
I'm the new maintainer for vsftpd and I opened the original bug. It's not a vsftpd problem, but a pam problem.
I do use virtual users, but they are LDAP and not db. Basically.any virtual that is not pam_userdb based works :)
Top
Raffi
l33t
l33t
User avatar
Posts: 731
Joined: Mon Mar 17, 2003 1:32 am
Location: Moscow, Id.

  • Quote

Post by Raffi » Fri Aug 05, 2005 11:36 pm

Good to know. So any change the userdb stuff will get fixed soon? Barring that, any chance there is a howto for other types of virtual users?

Thanks.
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Sat Aug 06, 2005 12:03 am

Raffi wrote:Good to know. So any change the userdb stuff will get fixed soon?
Soon? Probably not.
If you're using nptl,disabling it may help.
Barring that, any chance there is a howto for other types of virtual users?
What kinda of backend do you want
LDAP? Postgres? MySQL? something else?

Basically, take your pick. Most daemons - including vsftpd - have PAM support - and PAM works with LDAP, Postgres, etc etc - just not userdb files. Heh
Top
Raffi
l33t
l33t
User avatar
Posts: 731
Joined: Mon Mar 17, 2003 1:32 am
Location: Moscow, Id.

  • Quote

Post by Raffi » Sat Aug 06, 2005 12:31 am

The ftp server has mysql in use and has postgres available. Either of those would work for me.
Top
traal
n00b
n00b
Posts: 3
Joined: Sun Aug 14, 2005 5:32 am
Location: Göteborg, Sweden

sys-auth/pam_pwdfile to the rescue

  • Quote

Post by traal » Sun Aug 14, 2005 6:28 am

Hi,

I had the exact same problem, with vsftpd complaining about "priv_sock_get_result" due to the PAM problem. After googling for a bit, and reading the PAM documentation, I figured out how the pam_pwdfile.so module can also be used for virtual users. It uses a file in the same format as Apache's .htpasswd files, with lines of "username:password_crypt", so it's very simple to maintain, compared to cumbersome Berkeley DB files. :)

Right now, pam_pwdfile is masked, so:

Code: Select all

echo sys-auth/pam_pwdfile >> /etc/portage/package.keywords
emerge -tva pam_pwdfile
Previously, vsftpd used the file /etc/pam.d/vsftpd, but that changed, so nowadays it uses /etc/pam.d/ftp by default. If you want the old behaviour (I did!), you need to update your vsftpd.conf:

Code: Select all

echo pam_service_name=vsftpd >> /etc/vsftpd/vsftpd.conf
Next, you need to change your /etc/pam.d/vsftpd file. Notice that the "account" facility is not available from pam_pwdfile.so, so just use the regular pam_permit.so to let any account in, provided that they know their password. (The account facility is intended for temporarily disabling accounts, among other things.) Change your /etc/pam.d/vsftpd to look like this:

Code: Select all

auth    required pam_pwdfile.so pwdfile /etc/vsftpd/passwd_ftp
account required pam_permit.so
Now, all you need to do is simply to put lines of the form "username:password_crypt" into the /etc/vsftpd/passwd_ftp file!

I came up with a short Perl script to create md5 password hashes. Put this into /etc/vsftpd/filter.pl:

Code: Select all

#! /usr/bin/perl -w
use strict;

# filter "user:cleartext" lines into "user:md5_crypted"
# probably requires glibc

while (<>) {
    chomp;
    (my $user, my $pass) = split /:/, $_, 2;
    my $crypt = crypt $pass, '$1$' . gensalt(8);
    print "$user:$crypt\n";
}

sub gensalt {
    my $count = shift;
    my @salt = ('.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z');
    my $s;
    $s .= $salt[rand @salt] for (1 .. $count);
    return $s;
}
Remember to:

Code: Select all

chmod +x /etc/vsftpd/filter.pl
Now, try something like:

Code: Select all

cd /etc/vsftpd
touch cleartext
chmod go= cleartext
echo john:secret >> cleartext
./filter cleartext > passwd_ftp
...And that's it! Suddenly john can log in with the password "secret". If you want to simplify this even further, create a Makefile. Remember that the indented lines in a Makefile must be tab characters, not eight spaces!

Code: Select all

# /etc/vsftpd/Makefile
passwd_ftp: cleartext
        touch $@
        chmod 600 $@
        ./filter.pl $< >$@
This way, if you want to update your virtual users, simply:

Code: Select all

cd /etc/vsftpd
vi cleartext
make
Hope this was helpful. :)
Top
Raffi
l33t
l33t
User avatar
Posts: 731
Joined: Mon Mar 17, 2003 1:32 am
Location: Moscow, Id.

  • Quote

Post by Raffi » Sun Aug 14, 2005 2:33 pm

Very helpful, thanks. I will give it a try as soon as I get back from vacation.
Top
codine
n00b
n00b
Posts: 3
Joined: Fri Jan 30, 2004 6:46 pm

  • Quote

Post by codine » Wed Aug 31, 2005 1:30 pm

Worked for me thank you much!
Top
b.walla
n00b
n00b
Posts: 1
Joined: Fri Sep 09, 2005 5:30 pm

  • Quote

Post by b.walla » Fri Sep 09, 2005 5:32 pm

Thanks traal, you rock hard.
Top
stevodestructo
n00b
n00b
User avatar
Posts: 8
Joined: Tue Mar 15, 2005 10:56 pm
Location: the armpit of California
Contact:
Contact stevodestructo
Website

Re: sys-auth/pam_pwdfile to the rescue

  • Quote

Post by stevodestructo » Fri Sep 30, 2005 7:59 pm

traal wrote:Hi,
Hope this was helpful. :)
Thanks bunches man... this did the trick :-)
"It is as hard to see oneself as to look backwards without turning around"
~ Henry David Thoreau
Top
Jylppy
n00b
n00b
User avatar
Posts: 17
Joined: Mon May 10, 2004 7:04 pm
Location: Finland

Works fine! Thanks man!!

  • Quote

Post by Jylppy » Fri Jan 13, 2006 11:52 pm

:D
Top
poco
n00b
n00b
Posts: 11
Joined: Thu Jan 06, 2005 1:39 pm
Location: Nice, France
Contact:
Contact poco
Website

  • Quote

Post by poco » Mon Feb 06, 2006 9:22 am

Thanks :)
Top
fdamstra
n00b
n00b
Posts: 39
Joined: Wed Feb 11, 2004 1:44 pm
Location: Grand Rapids, MI
Contact:
Contact fdamstra
Website

Solved!

  • Quote

Post by fdamstra » Fri Feb 17, 2006 2:47 pm

Well, this pam_userdb problem has been troubling me for months and months. Converting to a different auth mechanism wasn't (isn't) a very good option for me as there's a management system built around the current system.

Anyhow, the solution is actually easy. In your /etc/pam.d/vsftpd or /etc/pam.d/ftp (whichever you use), add "crypt=hash" to the end of the auth and account lines. For instance, mine looks like this:

Code: Select all

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd.passwd crypt=hash
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd.passwd crypt=hash
Hope that helps somebody out.
Top
Saibei
n00b
n00b
Posts: 12
Joined: Mon Oct 11, 2004 4:31 pm
Location: Texas
Contact:
Contact Saibei
Website

  • Quote

Post by Saibei » Mon Mar 27, 2006 4:44 am

This looks to be exactly what I wish to do!

However, I can't for the life of me get it to work... can someone post an example vsftpd.conf?
www.liquidninjas.com
Top
Post Reply

23 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic