Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-19-2010, 04:48 AM   #1
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
vsFTPd and ftp_ssl_connect (php)

This question is related to vsFTPd and FTP+SSL, not PhP.

I have the following php-code (read a local file and write its contents through FTP to a remote server) :
$source = fopen("test.txt","r");
//Opening an ftp connection
$conn = ftp_ssl_connect("") or die("Could not connect");
ftp_login($conn,"user1","passwd1"); //log in to ftp session
if( !$conn ){
    echo "FTP server connection error" . "<BR>";
   echo "Connected to FTP Server" . "<BR>";
   echo "conn=".$conn."<br>";
   echo "putfile = ".$putfile."<br>";
echo "pwd: ".ftp_pwd($conn);
fclose($source); //close the local file
ftp_close($conn); //close the ftp session
The output is :
Connected to FTP Server
conn=Resource id #4
putfile =
So it seems that I am able to connect to the vsFTPd-server with user1 but nothing happens...

When using ftp_connect("") (not ssl) then everything works fine.

I'm a bit confused and worried about the possibility to be able to connect to the server.

My vsFTPD-server has ssl-support built-in :
[root@server ]# ldd /usr/sbin/vsftpd | grep ssl => /lib/ (0x00ec0000)
The user 'user1' has no shell :
[root@server ]# cat /etc/passwd | grep user1
I see nothing in the logfile /var/log/vsftpd.log when connecting with ftp_ssl_connect.

When connecting with ftp_connect, the logfile reads :
Fri Mar 19 09:29:56 2010 1 21 /test a _ i r user1 ftp 0 * c
So am I connected to the vsFTPd-server ??
Does my user1 needs a shell (tried it with /bin/bash but no change) ??
Will ftp_ssl_connect work with a local certificate (cd /etc/pki/tls/certs && make vsftpd.pem) ??
Is it not working because my 'user1' is chrooted to /etc/dir/addondir ??

Last edited by jonaskellens; 03-19-2010 at 04:49 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
vsftpd settingd and VSFTPD DEAD BUT SUBSYS LOCKED pc_copat Linux - Newbie 15 11-05-2009 11:31 PM
add virtual users to vsftpd with php mattsoftnet Programming 0 05-09-2008 01:33 PM
vsftpd.conf/chroot/vsftpd.chroot_list issue Jerman Linux - Security 2 06-01-2007 08:24 PM
vsftpd & ssl - how do I tell if it's actually vsftpd maintaining the connections?? hunterhunter Linux - General 0 03-27-2006 05:41 PM
VSFTPD with 500 oops :vsftpd: missing argv[0] mole_13 Linux - Newbie 0 05-04-2005 02:05 AM > Forums > Linux Forums > Linux - Newbie

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

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