ftp can't do ls

I am trying to use ftp on my system.

inetd is running and I think I have all of the /etc/ftp* files configured
properly. I can do GETs and PUTs just fine.

But if I do an LS or DIR, it appears that the remore directory is empty.

What am I doing wrong?

For the record, I’m trying to set up my system as an ftp server. However
for test purposes I’m using the same system as server and client. I.E.
ftp localhost

Bill Caroselli <qtps@earthlink.net> wrote:

I am trying to use ftp on my system.

inetd is running and I think I have all of the /etc/ftp* files configured
properly. I can do GETs and PUTs just fine.

But if I do an LS or DIR, it appears that the remore directory is empty.

What am I doing wrong?

For the record, I’m trying to set up my system as an ftp server. However
for test purposes I’m using the same system as server and client. I.E.
ftp localhost

Does ftp have a limited view/chrooted environment? If so, is there an
ls binary available within that chrooted environment?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs <dagibbs@qnx.com> wrote:
DG > Bill Caroselli <qtps@earthlink.net> wrote:

I am trying to use ftp on my system.

inetd is running and I think I have all of the /etc/ftp* files configured
properly. I can do GETs and PUTs just fine.

But if I do an LS or DIR, it appears that the remore directory is empty.

What am I doing wrong?

For the record, I’m trying to set up my system as an ftp server. However
for test purposes I’m using the same system as server and client. I.E.
ftp localhost

DG > Does ftp have a limited view/chrooted environment? If so, is there an
DG > ls binary available within that chrooted environment?

It is my intent that each user log in with his ftp root directory being
his home directory.

Assume I log in as ‘bill’.
bill is not mentioned in /etc/ftpusers
/etc/ftpchroot has a line that reads:
bill allow real

Isn’t this supposed to chroot when I ftp log in as bill?
But, ‘pwd’ inside of ftp shows /home/bill.

Bill Caroselli <qtps@earthlink.net> wrote:

David Gibbs <> dagibbs@qnx.com> > wrote:
DG > Bill Caroselli <> qtps@earthlink.net> > wrote:

I am trying to use ftp on my system.

inetd is running and I think I have all of the /etc/ftp* files configured
properly. I can do GETs and PUTs just fine.

But if I do an LS or DIR, it appears that the remore directory is empty.

What am I doing wrong?

For the record, I’m trying to set up my system as an ftp server. However
for test purposes I’m using the same system as server and client. I.E.
ftp localhost

DG > Does ftp have a limited view/chrooted environment? If so, is there an
DG > ls binary available within that chrooted environment?

It is my intent that each user log in with his ftp root directory being
his home directory.

Assume I log in as ‘bill’.
bill is not mentioned in /etc/ftpusers
/etc/ftpchroot has a line that reads:
bill allow real

Not sure what the “allow real” mean. I created one with:
blah allow
and one with:
blah

(userid blah for testing)
And in both cases, after logging in, both an “ls” failed, and a
“cd /tmp” failed. But, if the /etc/ftpchroot didn’t exist, both
the ls and the cd worked.

I’ve checked a couple books on setting this sort of thing up, and
some of the early common steps are:

Create a bin directory in the home directory…
cp /bin/ls to $/bin
chmod 111 $/bin/ls

Isn’t this supposed to chroot when I ftp log in as bill?

It appears to chroot for me.

But, ‘pwd’ inside of ftp shows /home/bill.

Dunno why – maybe cause that’s where you are?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com