Solved

FTP Linux server accessed from web browser

Posted on 1997-08-29
8
318 Views
Last Modified: 2013-12-23
My FTP server works fine in general except when someone access it with a graphical web browser (instead of the normal ftp command). In this case, the contents of directories are not listed despite you can download the files if you know the full path&name.
 
If you want to take a look at it, the anonymous FTP server name is
      nikolai.ija.csic.es
You would see that accessing it with the command
      ftp nikolai.ija.csic.es
you can do ls, get, cd, etc, while accessing it with a web browser (netscape) to the address ftp://nikolai.ija.csic.es/ no directory tree will appear.
 
I really can't manage with this trouble. I took a look at ftpaccess but didn't know what to do. Permisions in FTP home are read for everybody.  :-(

Any help will be great!
Thanks
0
Comment
Question by:dgarcia
8 Comments
 

Expert Comment

by:bkc
ID: 1582365
I logged into your system as an anonymous user with a command-line FTP client.

a LIST command produces NO OUTPUT.

I suspect that you do not have the directory ownership set correctly on your server.

/etc/ftpaccess controls only part of the security aspects.

The directory rights are also only part of the issue. You said everyone has read access, but if the 'owner' or 'group' do not
have read access, and the 'anonymous user' is the owner or in the group, the rights you've assigned to 'everyone' will not apply
to the anonymous user.


0
 
LVL 2

Accepted Solution

by:
nicademus earned 100 total points
ID: 1582366
Do the following, based around what bkc has said...I have tried to log in, but it is very slow, I also could not get a list from either Netscape or ftp....


cd /home
ls -lR ftp | more
look through the directory structure and verify that all the files are owned by root
change the ftp user's shell to /bin/false, because the user does not nee a shell to log in:

chsh ftp
Changing shell fot ftp.
New Shell [/bin/true]: /bin/false
You will get a warning...ignore it.

Now....change the ftp permission setting...
chmod 555 ~ftp

change the settings on ~ftp/bin and ~ftp/etc to 111, and the contents of ~ftp/bin also.

chmod 111 ~ftp/etc
chmod 111 ~ftp/bin
chmod 111 ~ftp/bin/*

now...
chmod 444 ~ftp/etc/*
chmod 555 ~ftp/pub
chmod 555 ~ftp/usr
chmod 555 ~ftp/lib
chmod 1733 ~ftp/incoming

if you don't already have a couple of files in the /home/ftp directory called .rhosts and .forward do the following...
touch ~ftp/.rhosts
touch ~ftp/.forward
chmod 400 ~ftp/.rhosts
chmod 400 ~ftp/.forward


Well all should work, but you also have to make sure that your FTPD is appropriately set up and running anyway.

I have attemtped to FTP a file to your incomign directory, which is the ftpaccess file which resides in your /etc directory, have a look at it and see if it is similar to yours.  If you cannot see it, try getting it from   ftp://mdm-209.quantum.net.au/pub/ftpaccess


Nica...
0
 

Expert Comment

by:hotlava
ID: 1582367
Your ftp daemon does not allow passive mode.  Enabling this could well be worth a try.
0
 

Author Comment

by:dgarcia
ID: 1582368
To Nicademus:
Thanks a lot before starting. Despite your question was very well exposed, I'm still trying. My ftpaccess seems to be ok (same as yours but changing the directory names in it). I have two doubts:
1) does the ftp directory tree have to be owned by root (as you said) or could it also be owned by ftp. Anyway, i tried both possibilities and nothing changed.
2) What do you mean with "make sure that your FTPD is appropriately set up".
 
To everybody:
1) What does it mean and how can I switch on the "passive ftp mode".
2) Somebody said that i should put a copy of the 'ls' command in my ftp/bin/. Is it necessary? Anyway, I also tried that and still it didn't work.

Sense of humour is the last thing to loose.  )8-D
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Expert Comment

by:nicademus
ID: 1582369
We'll get back to you...funny man....=)  I gotta think back as to why mine wasn't working some time back, when I first installed this Slakware CD set....
0
 

Author Comment

by:dgarcia
ID: 1582370
Still, I want to insist in the fact that *sometimes* you can do an ls when connecting via the manual ftp command. Examples:

1) from another AIX terminal to which i have access, you can connect and do 'ls', but you can't do 'ls -l' or 'dir' (you don't have an error, but there is no output except "PORT command successful; Opening ASCII...; Transfer complete.").

2) from the same AIX-IBM machine but connected as a local user of my problematic linux server (not as 'anonymous') you CAN do 'ls', 'ls -l' (with the same output as entered from the command line ls), 'dir' & whatever.  

3) from the linux server itself, you can connect as anonymous to the ftp server but there is no way to do neither ls NOR ls -l NOR dir.

etc...

I start to think about reviewing the difficulty rate of this question.

If you prefer e-mail contact: dgarcia@ija.csic.es
0
 

Author Comment

by:dgarcia
ID: 1582371
Still, I want to insist in the fact that *sometimes* you can do an ls when connecting via the manual ftp command. Examples:

1) from another AIX terminal to which i have access, you can connect and do 'ls', but you can't do 'ls -l' or 'dir' (you don't have an error, but there is no output except "PORT command successful; Opening ASCII...; Transfer complete.").

2) from the same AIX-IBM machine but connected as a local user of my problematic linux server (not as 'anonymous') you CAN do 'ls', 'ls -l' (with the same output as entered from the command line ls), 'dir' & whatever.  

3) from the linux server itself, you can connect as anonymous to the ftp server but there is no way to do neither ls NOR ls -l NOR dir.

etc...

I start to think about reviewing the difficulty rate of this question.

If you prefer e-mail contact: dgarcia@ija.csic.es
0
 

Author Comment

by:dgarcia
ID: 1582372
hotlava, how do i "enable the passive mode" of my ftp deamon?
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Join & Write a Comment

Some time ago I was asked to set up a web portal PC to put at our entrance. When customers arrive, they could see a webpage 'promoting' our company. So I tried to set up a windows 7 PC as a kiosk PC.......... I will spare you all the annoyances I…
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now