Operating System - HP-UX
1825689 Members
3554 Online
109686 Solutions
New Discussion

Re: ftp files from UNIX box for 4 different users

 
SOLVED
Go to solution
Nancy Stout
Frequent Advisor

ftp files from UNIX box for 4 different users

I have a request from 4 users to be able to ftp some spool files off of a specific directory on the Unix box to their P.C.'s. What would be the best way to accomplish this request?
8 REPLIES 8
John McWilliams_1
Frequent Advisor

Re: ftp files from UNIX box for 4 different users

Hi Nancy

Do these users have access to a shared directory in windows on their PC's?
I have this same situation and from windows I set up a scheduled job to ftp the files up from a known location on the unix server.
The other way if it is random is to have a script on the PC they can run that uploads the files.

Cheers John
Nancy Stout
Frequent Advisor

Re: ftp files from UNIX box for 4 different users

John,

I don't believe that the users have a shared directory. Do you have a script that does the copy that I might be able to put on each of their P.C's. I don't want them to be able to get to any other directory on the server except where the spool files are located.
Thank you for any assistance you can give.

Nancy
Dennis Handly
Acclaimed Contributor
Solution

Re: ftp files from UNIX box for 4 different users

Any reason they can't do it themselves? (If they have HP-UX logons.)
What do you mean by spool files? Are the users even going to be able to read those files?

>I don't want them to be able to get to any other directory on the server except where the spool files are located.

If they don't have logons, you could set up anonymous ftp to that directory.
Suraj K Sankari
Honored Contributor

Re: ftp files from UNIX box for 4 different users

Hi Nancy,
>>I don't want them to be able to get to any other directory on the server except where the spool files are located.
You have to configure chroot for the specific ftp user then he could not be access beond his directory.

Problem Description: How do I configure the new ftpd at HP-UX 11.0 to chroot on certain users?

Solution

Use this procedure to configure the new ftpd:

Note: A user will not have the ability to travel anywhere outside
of his home directory on the system. Setting up a bogus
shell with exit 0 as the contents will cause the connection
of a user to be immediately terminated if the user attempts
to telnet into the system.

1. Configure the ftpaccess file:

a. cd /etc/ftpd
b. cp -p /usr/newconfig/etc/ftpd/ftpaccess .
c. vi ftpaccess. At the bottom of the file there is a guestgroup
directive 'guestgroup ftponly'.

i. Either change that group designation to one you already
have or keep that designation.
ii. If you are keeping the ftponly group, then create that
group on your system.


2. Modify the /etc/inetd.conf file to enable the use of the ftpaccess
file:
a. vi /etc/inetd.conf
b. Add the -a flag to the ftp daemon.
c. ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a -l

4. Make inetd re-read its configuration:
inetd -c

5. Create a bogus shell for users that will only have FTP access to
the system:
a. vi /usr/bin/ftpshell
b. exit 0
c. chmod 555 /usr/bin/ftpshell
d. chown bin:bin /usr/bin/ftpshell

6. Create an /etc/shells file:
a. vi /etc/shells
b. Include these lines in the file:
/sbin/sh
/usr/bin/ksh
/usr/bin/sh
/usr/bin/csh
/usr/bin/rsh
/usr/bin/rksh
/usr/bin/keysh
/bin/sh
/bin/ksh
/bin/csh
/bin/rsh
/bin/rksh
/usr/bin/ftpshell

7. Now add a user to the system. Use a group that is 'ftponly' and
make the user's shell /usr/bin/ftpshell.

8. Use SAM to limit the user to his home directory by setting up the
directory in this form:
/home/username/./

Note: The /./ is the important key here. When the ftpd verifies a
user's login, it checks and sees that the user is a member of
the 'guestgroup' ftponly. It then examines the home directory
and, if it sees a /./ in the path, it will then perform a chroot
to that directory. Therefore, when that user FTPs into the
system, their home directory will appear as the / directory.

9. Provide the user with an ls command:

a. cd /home/username
b. mkdir usr
c. mkdir usr/bin
d. cp -p /sbin/ls usr/bin
e. chown -R bin:bin usr
f. chmod -R 555 usr

Suraj
Nancy Stout
Frequent Advisor

Re: ftp files from UNIX box for 4 different users

Suraj,

I want these users to be only able to access a directory called /ccsdata/RDI/CASS/sapout and no other directory. On this Itantium server running HPUX 11.23 there is no file ftpaccess. Does this change any of the information that you have supplied me. Is there a way that I could get the anonoymous logon to be able to see this specific directory. Right now the anonoymous logon can only see the directory /home/ftp. The other option that I see is to copy all of the files to /home/ftp, however to do this I would need to increase the space for the /home directory.

Nancy
Robert Salter
Respected Contributor

Re: ftp files from UNIX box for 4 different users

Hi Nancy,

Suraj has the steps you need to setup the ftpaccess. The file he suggested you copy is in /usr/newconfig/etc/ftpd/examples. You may also want to look here for more anonymouns ftp access info;
http://docs.hp.com/en/B2355-91058/index.html


Beers,

bob
Time to smoke and joke
Nancy Stout
Frequent Advisor

Re: ftp files from UNIX box for 4 different users

Thank you to everyone. We have decided to change the directory for anonymous logon and this appears to be working how they want.

Nancy Stout
Frequent Advisor

Re: ftp files from UNIX box for 4 different users

Thank you again for all of your responses.