Operating System - HP-UX
1828667 Members
1658 Online
109984 Solutions
New Discussion

Re: ftp user can not view files

 
SOLVED
Go to solution
Randy Lowe
Occasional Contributor

ftp user can not view files

First of all, let me give you come info. I did not setup or create this ftp account. My co-worker who is on vacation did.Why can't my ftp account users see the files? If you telnet or rlogin to the host as the ftp user account you can. But not when you ftp. It just takes you to the root.
The ftp account has ownership of all directories and files.
Only two things wrong with women, everything they say and everything they do.
10 REPLIES 10
Ian Dennison_1
Honored Contributor

Re: ftp user can not view files

If you do a 'cat /etc/inetd.conf', does the ftpd daemon have the '-a' option?

If the '-a' option is used, there is probably an incorrect permissions setup in /etc/ftpd/ftpaccess.

is there the code /./ somewhere in the User's home directory?

Share and Enjoy! Ian

Building a dumber user
Michael Elleby III_1
Trusted Contributor

Re: ftp user can not view files

Randy-

A question comes to mind. What do you see when you are in the root dir? Check the /etc/passwd directory to see what the home dir field is set to. I'm wondering if this ftp user is setup in a chrooted environment.

Mike-
Knowledge Is Power
Randy Lowe
Occasional Contributor

Re: ftp user can not view files

I looked at SAM. There is a /./ at the end of the assigned directory.
Only two things wrong with women, everything they say and everything they do.
Shannon Petry
Honored Contributor
Solution

Re: ftp user can not view files

The /./ means the user is chrooted to their home.
I.E.
user home is /home/ftp/./

You must create a bin directory for the ftpuser.
%mkdir /home/ftp/bin
inside there, you will need static linked binary for ls.
%cp -p /sbin/ls /home/ftp/bin
you will also need to link this to dir from the base directory.
% cd /home/ftp/bin
% ln -s ./ls ./dir

This should fix the problem.

Regards
Shannon
Microsoft. When do you want a virus today?
Ian Dennison_1
Honored Contributor

Re: ftp user can not view files

In addition to Shannon's entry, you will probably like the directory called /home/ftp/etc with the passwd and group file that detail the ownership of the files when listed.

Share and Enjoy! Ian
Building a dumber user
Michael Elleby III_1
Trusted Contributor

Re: ftp user can not view files

Lastly,

Make sure that the files you are attempting to access are located in a subdir (i.e. ~ftp/pub) with appropriate permissions in order to access the data when you initiate your ftp.

Mike-
Knowledge Is Power
Randy Lowe
Occasional Contributor

Re: ftp user can not view files

Shannon

you will also need to link this to dir from the base directory.
% cd /home/ftp/bin
% ln -s ./ls ./dir

I am confused. What do you mean by this dir above?
Only two things wrong with women, everything they say and everything they do.
Shannon Petry
Honored Contributor

Re: ftp user can not view files

Ian,

The /home/ftp/etc directory does not need to exist nor contain the passwd group file is used only to show names for UID/GID's in and FTP environment, and not required. (looks purdy is all).

Michael,

If a user has read/execute on directories and read access on files they can transfer the data they need. Personal opinion on anonymous FTP servers is that pub is used for public areas. Historically this was originally dist and pub was for upload. Personal preference is all. If i was in a bad mood a user may have to get their data from /home/ftp/antidisestablishmentarianism
as long as there were 500 permissions on the directory and the user owned it it works just fine.


Author,
Ensure that permissions on directories are 555 and files 400 for the user, binaries need to be minimum 500 for user to execute.

I know there is a ton of threads related to FTP configuration on the site. I myself have published 2 FAQ's for both secure and insecure FTP using both wu-ftp and proftp.

Regards,
Shannon
Microsoft. When do you want a virus today?
Randy Lowe
Occasional Contributor

Re: ftp user can not view files

WOW!...Excellent Job!!!
I can see them now!! You guys and girls did an excellent job!! Thank you so much!!!and have a SUPER GREAT WEEKEND!!!!
Only two things wrong with women, everything they say and everything they do.
Michael Elleby III_1
Trusted Contributor

Re: ftp user can not view files

Shannon, a quick point (not vying for points)

I only used ~ftp/pub as an example for a directory where files would be stored on an incoming ftp into the chrooted environment, hence the i.e. in front.... In my shop, I actually create a separate directory for every incoming ftp that uses the chrooted environment, this way, I keep things nice and orderly...

However, Thanx for the info..

Mike-
Knowledge Is Power