Operating System - HP-UX
1823057 Members
3074 Online
109645 Solutions
New Discussion юеВ

ftpaccess file and upload

 
SOLVED
Go to solution
TMcB
Super Advisor

ftpaccess file and upload

Hi

I have gone through all the posts regarding this subject, but still cannot get ftpaccess to work as I would like it to.

I have an ftp user (SGMftp) who's primary group is the ftponly group. The home directory is /tmp_mnt/reports/fats and the shell is usr/bin/false.

FTP works OK, and :
the files are created with the rw-r----- permission.

I would like this account to ftp the files, but another user to have access to the files, so I created the following line in ftpaccess
upload /tmp_mnt/reports/fats / fmdprod sgmfmd yes 0660

However, the files are still being created as :
-rw-r----- 1 SGMftp ftponly
-rw-r----- 1 SGMftp ftponly

Any help is much appreciated
Thanks
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: ftpaccess file and upload

Shell issue?

usr/bin/false

should be

/usr/bin/false

Add the second user to the ftponly group.

Make sure the permissions on the directory are

chmod g+r

so that other groups can access the directory.

I think this may work better than the ftpaccess solution.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TMcB
Super Advisor

Re: ftpaccess file and upload

Hi

sorry, typing mistake in 1st post - the shell is /usr/bin/false.

The permissions for the directory are already :
drwxrwxrwx 3 SGMftp ftponly 1024 Jun 2 16:15 fats

But when the files are ftp'd, no one else can access them (apart from root) as the permission is rw-r-----.

Because the SGMftp account is ftp only, they cannot use this to telnet on and change the permissions.

Thanks
john korterman
Honored Contributor

Re: ftpaccess file and upload

Hi,
your ftpacces config. line looks a little suspicious, especially the space between "/" and fmdprod".
If "fmdprod" is a dir under "/tmp_mnt/reports/fats", then remove the space.
The whole line should look somewhat like this:
upload /tmp_mnt/reports/fats /fmdprod yes 0660 dirs
where is the owner of the file and the group to which the file belongs.
It is my experience that every change in ftpaccess requires that restart of the inetd daemon.

regards,
John K.
it would be nice if you always got a second chance
TMcB
Super Advisor

Re: ftpaccess file and upload

fmd_prod is the user I would like to own the files afer they have been ftp'd into the directory.

I have changed the ftpaccess line to :
upload /tmp_mnt/reports/fats / yes fmd_prod sgmfmd 0660

and restarted inetdbut the files still have the permissions :
-rw-r----- 1 SGMftp ftponly 1068 Jun 3 09:13 aicense.txt
-rw-r----- 1 SGMftp ftponly 80541 Jun 3 09:13 check.txt
Borislav Perkov
Respected Contributor

Re: ftpaccess file and upload

Hi,

I have similar problem.
I think that you should change group owner on the directory /tmp_mnt/reports/fats from ftponly to sgmfmd and it will solve the problem.
Please send the ftpaccess file and the line for SGMftp in passwd file if you still have any problems. Also which is the version of FTP Server?

Regards,
Borislav
john korterman
Honored Contributor

Re: ftpaccess file and upload

Hi again,
when you establish the ftp session, do you then see the message: "User xxxx logged in. Access restrictions apply"?
If not, I think the definitions in ftpaccess are ignored.


regards,
John K.
it would be nice if you always got a second chance
TMcB
Super Advisor

Re: ftpaccess file and upload

Hi

I do get the "access restrictions apply" message", so I'm happy that ftpaccess is being used.
The user SGMftp can only ftp to the /tmp_mnt/reports/fats directory and cannot telnet onto the machine.

I changed the owner and group of the folder but it hasn't made any difference.

I have attached the ftpaccess file.
Borislav Perkov
Respected Contributor
Solution

Re: ftpaccess file and upload

Try to change:
upload /tmp_mnt/reports/fats / yes fmd_prod sgmfmd 0660
to
upload /tmp_mnt/reports * no
upload /tmp_mnt/reports /fats yes fmd_prod sgmfmd 0660
regards.
Borislav Perkov
Respected Contributor

Re: ftpaccess file and upload

Opps,
Try this entry in passwd
SGMftp:nnnnnnnnnnn:148:101:FTP user,,,:/tmp_mnt/reports/./fats:/usr/bin/false

Borislav Perkov
Respected Contributor

Re: ftpaccess file and upload

Sorry.
I've meaned try to change home directory entry in passwd file to :
/tmp_mnt/reports/./fats
TMcB
Super Advisor

Re: ftpaccess file and upload

Hi Borislav


Thanks you very much for your help.

It is now working OK.
I changed the entry in ftpaccess and the passwd file, and the permissions are now :
-rw-rw---- 1 fmd_prod sgmfmd 1068 Jun 3 10:43 aicense.txt
-rw-rw---- 1 fmd_prod sgmfmd 80541 Jun 3 10:43 check.txt

Thanks again.