Operating System - HP-UX
1837893 Members
3546 Online
110122 Solutions
New Discussion

Re: Is ftp-only account possible?

 
SOLVED
Go to solution
zhaogui
Super Advisor

Is ftp-only account possible?

Recently I read a article about some tricks used in creating ftp-only account. But it requires creation of /etc/shells and put en entry of noop there. But there is no /etc/shells and if I didn't create this, I just ended up "user ftponly access denied". Anyone got idea on this?

The /etc/passwd entry for our ftp-only user looks like this:

ftponly:x:106:10:FTP Only:/home/ftponly:/bin/noop
4 REPLIES 4
Steve Steel
Honored Contributor
Solution

Re: Is ftp-only account possible?

Hi

You need /etc/shells

see man shells


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Sebastian Galeski_1
Trusted Contributor

Re: Is ftp-only account possible?

Try to use next procedure:

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


regards Seba
zhaogui
Super Advisor

Re: Is ftp-only account possible?

Thank you for your quick response. But how come it still showed unassgined after I already assigned points?

I already get it work, just put in /bin/noop into /etc/shells and it can allow you to do ftp only. For telnet it just shows "No shell".

Thank you again.
Yogeeraj_1
Honored Contributor

Re: Is ftp-only account possible?

Hello,

I had a similar question and few problems implementing this on my system.

Maybe these links will be of help too:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xfcc491ccb36bd611abdb0090277a778c,00.html

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe57e107d277ad611abdb0090277a778c,00.html

Also, the HP reference document:
http://us-support.external.hp.com/cki/bin/doc.pl/sid=f3889157083aef0a6e/screen=ckiDisplayDocument?docId=500000000092476

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)