Operating System - HP-UX
1753811 Members
8004 Online
108805 Solutions
New Discussion юеВ

Re: directory not visible in ftp session

 
prasadb
Super Advisor

directory not visible in ftp session

hello all ..

i have HP-UX superdome server. the version B.11.11. i have one strange problem.

there are some users on the users to whom /usr/bin/false shell has been alloted, so that they can have only FTP session but not the telnet.

well, now the problem is that once the user login into the FTP session, and fire pwd command they see this message.

"257 "/" is current directory.". whereas, the home directory is set properly. i have checked it in passwd file.

And when he hits "ls" command , files are not visible in the session. check the session as below..

Also, i changed the shell to /usr/bin/sh, the normal shell by default, but the problem still exists.

Following is the message the user getting.

# ftp 10.4.5.62

Name (10.4.5.62:root): gujtap
331 Password required for gujtap.
Password:
230 User gujtap logged in. Access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (10,4,5,62,192,74)
150 Opening ASCII mode data connection for /usr/bin/ls.
226 Transfer complete.
ftp> pwd
257 "/" is current directory.
ftp>


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

Help !!!!
27 REPLIES 27
prasadb
Super Advisor

Re: directory not visible in ftp session

i forgot to metion that , when i do the same from the command prompt, it works fine, the problem is only when the the user is doing it from another server.
prasadb
Super Advisor

Re: directory not visible in ftp session

Till nobody there ? :-)

i have posted one more question on Linux Admin group, plz see that too :-)

Dennis Handly
Acclaimed Contributor

Re: directory not visible in ftp session

Is this user's ftp chrooted?
Can you do "ls -i" to get the inode then use
find(1) to find what directory is /?
prasadb
Super Advisor

Re: directory not visible in ftp session

# cat /etc/passwd | grep gujtap
gujtap:HqwLe1vYyxNB6,5.oT:136:20:,,,:/uu08/gujtap:/bin/false
#
# cd /uu08/gujtap
# ls -i
2994 .cshrc 2997 .profile 4338 CDINDMPINDBI03248
2995 .exrc 3002 .sh_history 2998 ideabill
2996 .login 4330 CDINDMPINDBI03247 4340 test


NOTE:gujtap is the user who has the problem.

Best Regards,
prasad
john korterman
Honored Contributor

Re: directory not visible in ftp session

Hi prasabd,

without knowing the details about your system, I think the above is a description of how a secure ftp session is actually supposed to work: when the user logs on in a restricted ftp session he is not supposed to se anything above his starting point, which is why the system displays "/" as his home dir.
When the user executes ls, nothing happens because he has not access to the normal /usr/bin/ls. You can remedy that by making the /usr/bin directory structure under the user's home dir and then copy the root user's ls command ie. /sbin/ls to the user's /usr/bin/ls
which should work. member execute permission!

regards,
John K.
it would be nice if you always got a second chance
Dennis Handly
Acclaimed Contributor

Re: directory not visible in ftp session

# cd /uu08/gujtap
# ls -i

Oops that should have been "ls -dli" in ftp.
You obviously know it isn't the same directory as /uu08/gujtap.
prasadb
Super Advisor

Re: directory not visible in ftp session

>when the user logs on in a restricted ftp session he is not supposed to se anything

exactly. but what about the files that come under his home directory ? and as expained when he does it from the command prompt, he is able to see the files, but when he does it from the another server he is able to do so.

Let say, my server is X and he opens FTp session from Y or any other sever then he can login into that but not able to "see" any file.
prasadb
Super Advisor

Re: directory not visible in ftp session

Dear Dennis,


# cd /uu08/gujtap
# ls -dli
2993 drwxr-xr-x 3 gujtap users 8192 Jan 12 13:31 .
#
# ls
.cshrc .login .sh_history CDINDMPINDBI03248 test
.exrc .profile CDINDMPINDBI03247 ideabill
Dennis Handly
Acclaimed Contributor

Re: directory not visible in ftp session

># ls -dli

Now you need to do this command IN ftp. That will tell you what directory you are actually using.