LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Very Secure FTP (vsftpd) is refusing to start on Slackware Current (https://www.linuxquestions.org/questions/linux-server-73/very-secure-ftp-vsftpd-is-refusing-to-start-on-slackware-current-767516/)

WhisperiN 11-07-2009 07:26 AM

Very Secure FTP (vsftpd) is refusing to start on Slackware Current
 
Hello Fellows,

I have had a fresh Slackware installation, in fact It's a Virtual box that I paid for..

The original installation came with Slackware 12.1 with the minimum requirements and I had to upgrade it to current, and install every thing I need, stating at get, slackpkg, which, and so on..!!

Any way, one of the many things I've installed was vsFTPD.
I tried to start it using the inted (the super server), and also in stand alone.. but it's not starting at all..

When I try to start it like:

Code:

root@slacky:/# vsftpd
It takes ages.. with no results, till I get to cancel by hitting CTRL+C.

Any idea what would be the problem?
I doubt that there are few needed libraries or something like that?
I googled.. but didn't get to any helpful results..


Thanks in advance..!!

ammorais 11-07-2009 07:42 AM

Code:

/etc/rc.d/rc.inetd start
or
Code:

/etc/rc.d/rc.inetd restart

Don't forget to configure first

Code:

vim /etc/vsftpd.conf
vim /etc/inetd.conf

Here's a manual
http://www.basicconfig.com/linuxnetwork/ftp_server

WhisperiN 11-07-2009 12:48 PM

Hello ammorais,

At first, Thanks a lot for replying..

To let you know, I have tried all what you said earlier before I post this.
In fact, this is not the first time I install vsftpd.
I had installed and well configured on several other boxes, Slack and CentOS..
All works like charm.. only this one, something is not working..!!

Regard..

ammorais 11-07-2009 12:56 PM

Please post the your vsftpd.conf and inetd.conf

Also have a look on my previous thread responses to vsftpd.
http://www.linuxquestions.org/questi...or-ftp-766636/
http://www.linuxquestions.org/questi...tening-766800/

WhisperiN 11-07-2009 01:21 PM

Sure thing,

Here they are:

I have mostly enabled every thing in vsftpd.conf trying to figure out the problem:

Code:

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=apache
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to My FTP service.
ls_recurse_enable=YES
listen=YES

Still not working..!!

Here is inetd.conf, I tried to start vsftpd from inted, and as stand alone.. neither worked..

Code:

time            stream  tcp    nowait  root    internal
time            dgram  udp    wait    root    internal
comsat        dgram  udp    wait    root    /usr/sbin/tcpd  in.comsat
pop3    stream  tcp    nowait  root    /usr/sbin/tcpd  /usr/sbin/popa3d
auth    stream  tcp    wait    root    /usr/sbin/in.identd    in.identd


Any suggestions?

WhisperiN 11-07-2009 01:30 PM

By the way, thanks for your other replies (the ones you pointed to)

I had a look on them, I don't think they solve my problem..


I repeat my thanks.. :)

ammorais 11-07-2009 01:49 PM

Your welcome. Let's hope your problem is fixed.
I have some experience with ftp servers since I'm writing a FTP client program, and I had to set almost every open-source ftp servers to test my program.

Also as you probably imagine, making a ftp client program give me a lot of knolege on FTP.

I have to tell you I'm not familiarized with inetd and it's been a while since I use slack.

But I see two apparent problems in your configuration files if you want to work with inetd.

Change listen=YES to listen=NO.
Listen is used in standalone only, so if you want to test both standalone and inetd you have to disable listen.

Also I don't see an ftp line on inetd.conf

add to inetd.conf
Code:

# Very Secure File Transfer Protocol (FTP) server.
ftp stream tcp nowait root /usr/sbin/tcpd vsftpd

Also try to make vsftpd.conf very simple, so you can identify problems adding feature by feature.

Try this only as your vsftpd.conf:
Code:

anonymous_enable=YES
local_enable=YES
write_enable=NO
listen=NO

ensure that your vsftpd service is stopped.

/etc/rc.d/vsftpd stop

restart inetd

/etc/rc.d/rc.inetd restart

This will test your vsftpd trough inetd

To test standalone

comment comment the ftp line on inetd.conf
Code:

# Very Secure File Transfer Protocol (FTP) server.
#ftp stream tcp nowait root /usr/sbin/tcpd vsftpd

change vsftp.conf
Code:

anonymous_enable=YES
local_enable=YES
write_enable=NO
listen=YES

stop inted and start vsftpd

/etc/rc.d/rc.inetd stop
/etc/rc.d/vsftpd start

WhisperiN 11-08-2009 02:34 AM

ammorais, I repeat my thanks..

But, I'm sorry to say, I guess you didn't understand my problem quite well.
I don't have problem into the way I use to start vsftpd..
I totally know, how to start it as a stand alone service, or via inetd.
So, the way to start it isn't the problem.

The problem, is the vsftp itself is refusing to start no matter how it was called..

When I type into the shell:

Code:

# vsftpd
I never got the command line back.. till I cancel the issued command.. (humm am I clear?)

So, what would be preventing vsftpd of being run?
a Socket?
a missed library?
a dependency?


Don't know.. that's what I'm trying to figure out..!!

pcunix 11-08-2009 05:46 AM

Trace it with "strace"

Yeah, that's a pain in the neck, but it might give you a clue.

You don't need to understand much to benefit. You'll see lines like:

Code:

open("/etc/mtab", O_RDONLY)            = 3

That's a succesful open. A failure looks like this:
Code:

open("/tmp/thingy", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

Pretty obvious, even if you didn't realize that the "-1" meant a problem.

Of course, the more you understand about system calls and programming, the more you can glean from strace output. If nothing else, you might spot where it is hanging/looping and posting that might give someone more familiar with its innards the needed clue.

WhisperiN 11-08-2009 02:17 PM

Alright, here you are..

Code:

root@slacky:~# strace vsftpd
execve("/usr/sbin/vsftpd", ["vsftpd"], [/* 25 vars */]) = 0
brk(0)                                  = 0x806b000
uname({sys="Linux", node="slacky", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=11663, ...}) = 0
mmap2(NULL, 11663, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f1c000
close(3)                                = 0
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p1\0\0004\0\0\0\254"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=105131, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f1b000
mmap2(NULL, 100328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f02000
mmap2(0xb7f17000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0xb7f17000
mmap2(0xb7f19000, 6120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f19000
close(3)                                = 0
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \7\0\0004\0\0\0,"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=42595, ...}) = 0
mmap2(NULL, 201052, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ed0000
mmap2(0xb7ed9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0xb7ed9000
mmap2(0xb7edb000, 155996, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7edb000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \n\0\0004\0\0\0\\"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=13419, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ecc000
mmap2(0xb7ece000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7ece000
close(3)                                = 0
open("/lib/libresolv.so.2", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@&\0\0004\0\0\0\330"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=86867, ...}) = 0
mmap2(NULL, 88132, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7eb6000
mmap2(0xb7ec8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11) = 0xb7ec8000
mmap2(0xb7eca000, 6212, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7eca000
close(3)                                = 0
open("/lib/libutil.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\t\0\0004\0\0\0000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=12407, ...}) = 0
mmap2(NULL, 12424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7eb2000
mmap2(0xb7eb4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7eb4000
close(3)                                = 0
open("/lib/libcap.so.2", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\16\0\0004\0\0\0\374"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=14820, ...}) = 0
mmap2(NULL, 17552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ead000
mmap2(0xb7eb1000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb7eb1000
close(3)                                = 0
open("/usr/lib/libssl.so.0", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\273\0\0004\0\0\0D"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0555, st_size=283948, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7eac000
mmap2(NULL, 286136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e66000
mmap2(0xb7ea8000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x41) = 0xb7ea8000
close(3)                                = 0
open("/usr/lib/libcrypto.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300p\3\0004\0\0\0\4"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0555, st_size=1350420, ...}) = 0
mmap2(NULL, 1356632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7d1a000
mmap2(0xb7e4d000, 90112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x132) = 0xb7e4d000
mmap2(0xb7e63000, 9048, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7e63000
mprotect(0xbf9f9000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = 0
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0h\1\0004\0\0\0\214"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1658350, ...}) = 0
mmap2(NULL, 1439312, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7bba000
mmap2(0xb7d14000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15a) = 0xb7d14000
mmap2(0xb7d17000, 9808, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7d17000
close(3)                                = 0
open("/lib/libattr.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\r\0\0004\0\0\0,"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=14396, ...}) = 0
mmap2(NULL, 17076, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7bb5000
mmap2(0xb7bb9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb7bb9000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bb4000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bb3000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7bb36c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7d14000, 8192, PROT_READ)  = 0
mprotect(0xb7eb4000, 4096, PROT_READ)  = 0
mprotect(0xb7ec8000, 4096, PROT_READ)  = 0
mprotect(0xb7ece000, 4096, PROT_READ)  = 0
mprotect(0xb7ed9000, 4096, PROT_READ)  = 0
mprotect(0xb7f17000, 4096, PROT_READ)  = 0
mprotect(0xb7f3d000, 4096, PROT_READ)  = 0
munmap(0xb7f1c000, 11663)              = 0
brk(0)                                  = 0x806b000
brk(0x808c000)                          = 0x808c000
stat64("/etc/vsftpd.conf", {st_mode=S_IFREG|0644, st_size=4559, ...}) = 0
open("/etc/vsftpd.conf", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=4559, ...}) = 0
mmap2(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7baf000
mprotect(0xb7bb2000, 4096, PROT_NONE)  = 0
mprotect(0xb7baf000, 4096, PROT_NONE)  = 0
read(3, "# Example config file /etc/vsftpd"..., 4559) = 4559
mprotect(0xb7baf000, 4096, PROT_READ)  = 0
munmap(0xb7baf000, 16384)              = 0
close(3)                                = 0
stat64("/etc/vsftpd.conf", {st_mode=S_IFREG|0644, st_size=4559, ...}) = 0
getuid32()                              = 0
getuid32()                              = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
rt_sigaction(SIGCHLD, {0x805e520, ~[RTMIN RT_1], SA_RESTORER, 0xb7be54f8}, NULL, 8) = 0
rt_sigaction(SIGALRM, {0x805e590, ~[RTMIN RT_1], SA_RESTORER, 0xb7be54f8}, NULL, 8) = 0
rt_sigaction(SIGHUP, {0x805e520, ~[RTMIN RT_1], SA_RESTORER, 0xb7be54f8}, NULL, 8) = 0
rt_sigaction(SIGALRM, {0x805e590, ~[RTMIN RT_1], SA_RESTORER, 0xb7be54f8}, NULL, 8) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(3, 32)                          = 0
accept(3,

It stopped right there.. or in other meaning it hanged right there..
To be honest, I couldn't derive the failure reason.. as I'm not too geek :$ !!

Dose it show you something?

Regards..

pcunix 11-08-2009 02:27 PM

I'm not going to read all that, but the "listen" is what it's supposed to do.

Did you look at netstat or lsof to see if it is listening for connections?

Did you try "ftp localhost" ?

I think I see your issue. You said "I never got the command line back.". Not all daemons fork themselves off - many expect to run in background - you'd do "vsftpd &" unless vsftpd is supposed to background itself.
.

WhisperiN 11-08-2009 06:04 PM

Quote:

Originally Posted by pcunix (Post 3749546)
I think I see your issue. You said "I never got the command line back.". Not all daemons fork themselves off - many expect to run in background - you'd do "vsftpd &" unless vsftpd is supposed to background itself.
.

You are going to laugh..

I figured that I solved this problem earlier by installing some needed packages.. or I think so..

Any way, I was trying the whole way to start vsftpd like:
Code:

~# vsftpd
I tried your hint to run it in the background..
to find out that it's already running..!!

Well, I guess some kind of miracles blessed the vsftpd and got it to work.. lol

Don't ask me how, I don't know :p

..

You deserved a Thump Up :-)

Regards all ..

alisonken1 12-15-2009 12:29 AM

Late, I know.

Also, don't forget to check your /etc/hosts.allow and /etc/hosts.deny files for host access controls


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