Operating System - HP-UX
1837519 Members
3657 Online
110117 Solutions
New Discussion

anonymous ftp server on HP-UX 11.11

 
Peter Kain
Advisor

anonymous ftp server on HP-UX 11.11

I was just wondering, HP Docs gives an example on how to build an anonymous ftp server. One of the steps copies over the commands pwd and ls.

Why do this since the commands pwd and ls are built commands in ftp. Is there some historical reason?

# Copy the ls and pwd commands from /sbin to ~ftp/usr/bin, and set the permissions on the commands to 0111 (executable only):

cp /sbin/ls /home/ftp/usr/bin
cp /sbin/pwd /home/ftp/usr/bin
chmod 0111 /home/ftp/usr/bin/ls
chmod 0111 /home/ftp/usr/bin/pwd
2 REPLIES 2
James A. Donovan
Honored Contributor

Re: anonymous ftp server on HP-UX 11.11

They are assuming that you are going to build a chroot "jail" for any users logging into your system anonymously. That is, these users will not be able to freely browse all your file systems.

Therefore, you need to copy statically linked versions of these utilities into the specified directories to allow the anonymous users access to the functions provided by these utilities.
Remember, wherever you go, there you are...
Peter Kain
Advisor

Re: anonymous ftp server on HP-UX 11.11

But it works without the commands as well. The "ls" and the "pwd" commands are built into the ftp command. I tested it by removing the commands in ~ftp/usr/bin and it still worked. Only the built in "ls" was limited with no flags.

If you run help after logging in via ftp the commands include "ls" and "pwd".

ftp> help ls
ls list contents of remote directory
ftp> help pwd
pwd print working directory on remote machine

I'm thinking maybe in the past ftp didn't have these commands built in and it just carried over when building anonymous ftp.