LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   vsftpd: cannot locate user specified in 'ftp_username':ftp (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/vsftpd-cannot-locate-user-specified-in-ftp_username-ftp-757340/)

zvivered 09-23-2009 03:50 PM

vsftpd: cannot locate user specified in 'ftp_username':ftp
 
Hello,

I'm trying to run vsftpd 2.2.0 under vanilla linux 2.6.29.
All the file system was built from scratch. I'm using busybox.

I ran vsftpd with: /sbin/vsftpd /etc/vsftpd.conf
Attached the vsftpd.conf I used.

When I tried to login from another PC I got the message:

P:\>ftp 128.127.y.x
Connected to 128.127.x.y.
500 OOPS: vsftpd: cannot locate user specified in 'ftp_username':ftp
Connection closed by remote host.

Before running I added the user ftp to /etc/passwd. I checked it by "su - ftp". It works.

Thanks,
Zvika.

bathory 09-23-2009 04:19 PM

Quote:

Before running I added the user ftp to /etc/passwd. I checked it by "su - ftp". It works.
How did you add the user in /etc/passwd? If you edit the file and add the user by hand, you should do the same for /etc/shadow.
Also "su - ftp" shouldn't work, because you don't have to give that user a valid shell.

zvivered 09-23-2009 08:21 PM

I created the ftp user with "adduser"
 
Quote:

Originally Posted by bathory (Post 3694748)
How did you add the user in /etc/passwd? If you edit the file and add the user by hand, you should do the same for /etc/shadow.
Also "su - ftp" shouldn't work, because you don't have to give that user a valid shell.

The user ftp was created by: adduser -h /var/ftp ftp
But after doing so, no line was added to /etc/shadow.

On my CentOS PC the line in /etc/passwd is:
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
and in /etc/shadow is:
ftp:*:14471:0:99999:7:::

Should I use those lines exactly in my embedded linux ?

Thanks.

bathory 09-24-2009 12:05 AM

Add the missing line in /etc/shadow and see if it helps.

zvivered 09-24-2009 10:17 PM

Adding the line to /etc/shadow did not help
 
Quote:

Originally Posted by bathory (Post 3695088)
Add the missing line in /etc/shadow and see if it helps.

vsftpd is calling to getpwnam ("ftp"). The pointer returned in NULL.
What can cause this problem ?

Thanks.

bathory 09-25-2009 12:26 AM

I don't know what the problem is, but from the function name, I guess it complains because it cannot find a password for the user ftp.
Anyway doing a little search I came accross thisregarding the 1st problem.
Quote:

Problem: When trying to ftp into the slug, it gives a message 500 OOPS: vsftpd: cannot locate user specified in 'ftp_username':ftp""

Solution: Change the echo line in /unslung/rc.xinetd to: echo "ftp stream tcp nowait root /opt/sbin/vsftpd /opt/etc/vsftpd.conf" >>/etc/inetd.conf
Hope that helps.

Regards

zvivered 10-09-2009 09:19 PM

Solution - bad toolchain
 
It seems the cause to the problem was the toolchain I used. The original toolchain I used was created with Dan Kegel's crosstool 0.43. It was based on old kernel header files (2.6.12).

When I created the toolchain with crosstool-ng, it worked fine.

Thanks.


All times are GMT -5. The time now is 10:01 AM.