Operating System - HP-UX
1751704 Members
5462 Online
108781 Solutions
New Discussion юеВ

Re: directory not visible in ftp session

 
Elmar P. Kolkman
Honored Contributor

Re: directory not visible in ftp session

Since logging is enabled, what does the ftpdaemon report in the syslog.log file when the restriction is enabled ?
And what is in the ftpusers file ?
Every problem has at least one solution. Only some solutions are harder to find.
Steven Schweda
Honored Contributor

Re: directory not visible in ftp session

> NOTE:this problem exists for some
> particular users, not all.

[...]
> # specify which group of users will be treated as "guests".
[...]
> guestgroup ftpusers
[...]

So, are any of these problem users in the
"ftpusers" group? (Do you have an "ftpusers"
group?)

> > Is this user's ftp chrooted?
>
> Well, is it?

_Still_ waiting for an answer to that one.

A guest user would get the chroot(), which
could explain the "257 "/" is current
directory." message. And, if you didn't read
"man ftpd" (or equivalent), and so you didn't
follow the directions for setting up these
users' home directories ("[...] exactly as
anonymous FTP would be [...]"), then that
could also explain the "ls" problem.

> would anybody like to throw some light on
> this issue ?

You first.

Even if "ls" does not work, you could put a
file into a user's home directory, and then
try to fetch it by name using FTP. (You
don't need a working "ls" if you already know
the file name.) If that works, then you'll
know that you're in the right directory, and
if the FTP server was calling it "/", then
you'll know that it has done a chroot(). And
if that's true, then "man ftpd" and "man
ftpaccess" should provide all you need to
know. (At least about this problem.)

Another possible clue, using the HP-UX FTP
client: The FTP client "ls" command sends a
"LIST" command to the FTP server, and that
needs a working "ls" program. The "nlist"
command sends an "NLST" command to the FTP
server, and that does _not_ need a working
"ls" program. For example, without a good
"ls" (because I renamed "usr" to "usr_"):

ftp> debug
Debugging on (debug=1).
ftp> ls
---> PORT 10,0,0,39,193,134
200 PORT command successful.
---> TYPE A
200 Type set to A.
---> LIST
150 Opening ASCII mode data connection for /usr/bin/ls.
226 Transfer complete.
[Note the lack of useful output there.]
---> TYPE I
200 Type set to I.
ftp> nlist
---> PORT 10,0,0,39,193,135
200 PORT command successful.
---> TYPE A
200 Type set to A.
---> NLST
150 Opening ASCII mode data connection for file list.
etc
dist
upload
usr_
[Note the non-empty file list.]
226 Transfer complete.
---> TYPE I
200 Type set to I.
ftp> pwd
---> PWD
257 "/" is current directory.
ftp>

Again, with a good "ls" ("usr" is "usr"
again):

ftp> ls
---> PORT 10,0,0,39,193,150
200 PORT command successful.
---> TYPE A
200 Type set to A.
---> LIST
150 Opening ASCII mode data connection for /usr/bin/ls.
total 0
dr-xr-xr-x 2 root other 96 Jan 7 2008 dist
dr-xr-xr-x 2 root other 96 Jan 7 2008 etc
drwxr-xr-x 2 ftp daemon 96 Nov 21 21:58 upload
dr-xr-xr-x 4 root other 96 Jan 7 2008 usr
226 Transfer complete.
---> TYPE I
200 Type set to I.
ftp>

As the message says, the FTP server is
looking for "/usr/bin/ls". If it can't find
one, then it can't provide a LIST report.
prasadb
Super Advisor

Re: directory not visible in ftp session

>You have a line that looks strange. Did it get chopped when you pasted it?
Dennis, the file is a session log from putty, it is as it is on the machine, no manupulations done.
>what does the ftpdaemon report in the syslog.log file when the restriction is enabled ?
Nothing about this issue.
>Is this user's ftp chrooted?
no chroot used for any command for any user.
>specify which group of users will be treated as "guests" ?
?
> Do you have an "ftpusers" group?)
yes, i have.

plz see the line from /etc/group..

ftpusers::106:delhitap,gujtap,hptap

and these users had above explained problem.

waiting for your valuable inputs/comments..
Steven Schweda
Honored Contributor

Re: directory not visible in ftp session

> no chroot used for any command for any user.

"man ftpd". Look for "chroot". _You_ are
not using chroot(), but the FTP server is.

> and these users had above explained problem.

Amazing.

> waiting for your valuable inputs/comments..

You already have them. All "5 pts" worth.
Do you want me to type it all again? You
might try reading "man ftpd". Have I
suggested reading "man ftpd"? I believe that
it's all explained in the ftpd "man" page.
If that fails, try also "man ftpaccess".
Then go back and read "man ftpd" again.
Dennis Handly
Acclaimed Contributor

Re: directory not visible in ftp session

>the file is a session log from putty, it is as it is on the machine, no manipulations done.

Then you need to fix that line. (Unless that line was split when attached?)

If that doesn't fix it, you may have to comment out lines in ftpaccess until you find what causes it to fail.
Steven Schweda
Honored Contributor

Re: directory not visible in ftp session

Did you ever solve this problem? How?
prasadb
Super Advisor

Re: directory not visible in ftp session

hello Steven,

>Did you ever solve this problem? How?

This is excerpt that i have already explained in the thread ..

"
well, i have done some changes in /etc/inetd.conf file as below
#ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l
previously it was ..
#ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -a -d
i removed the "-a" option, and the user is able to view the o/p of "pwd" as well as the "ls" commands. "

Having tried this, i am keen to know the reason behind it :-)
Steven Schweda
Honored Contributor

Re: directory not visible in ftp session

> This is excerpt that i have already
> explained in the thread ..

If you call that a solution.

> and these users had above explained problem.

As I may have hinted, "man ftpd" and "man
ftpaccess" should explain this stuff. You
say that have this in your
/etc/ftpd/ftpaccess file:

guestgroup ftpusers

and this in /etc/group:

ftpusers::106:delhitap,gujtap,hptap

That would make these users "guest" users,
which means that you need to set up their
home directories just as for the anonymous
user, as explained in the ftpd "man" page.

I had hoped that you would try that
ftp> nlist
test to confirm that the only problem is with
the "ls" program. Then I might suggest
looking for "ls" and/or "/sbin/ls" while
you're reading "man ftpd".

> Having tried this, i am keen to know the
> reason behind it :-)

So you say, but if you were all that keen, I
would have expected you to try some of the
things I suggested at Jan 14, 2009 06:59:51
GMT, and report back with the results.