1847115 Members
5903 Online
110263 Solutions
New Discussion

Re: FTP security

 
Chris C. Guevarra
Occasional Contributor

FTP security

I only want one user to be able to use ftp.

How can I limit the use of ftp on a particular server?
5 REPLIES 5
Naveej.K.A
Honored Contributor

Re: FTP security

Hi,

Use ftpaccess.

man 4m ftpaccess for more details.

Regards,
Naveej
practice makes a man perfect!!!
Indira Aramandla
Honored Contributor

Re: FTP security

Hi chris,

To allow one a particular user to use ftp you do like this

a) Create /etc/ftpusers file
b) Add the login id of the user you wanted to deny the ftp access.

For Hosts you can use inetd.sec file to allow or deny the access to ftp on your machine.


IA
Never give up, Keep Trying
Joseph Loo
Honored Contributor

Re: FTP security

hi,

consider ftpaccess:

http://docs.hp.com/en/B2355-90685/ch02s07.html?btnPrev=%AB%A0prev

http://docs.hp.com/en/B2355-90685/ch02s08.html?btnNext=next%A0%BB

and to restrict user to their home directory:

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062903488

u may also refer to these steps:

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

3. Make inetd re-read its configuration:

inetd -c

4. 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

5. 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

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

7. 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.

8. 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



if the user runs the ftp from only a particular host, u may restrict using /var/adm/inetd.sec.

regards.
what you do not see does not mean you should not believe
Hoang Chi Cong_1
Honored Contributor

Re: FTP security

Hi

The most simply is setting in the inetd.sec file (under /var/adm/inetd.sec)
You just specific which IP address can ftp to your server by adding one line in the inetd.sec file:

ftp allow

then :
#inetd -c
While add this line, by default ONLYthe listed IP can ftp to your server!

Hope this helps
Regard,
Hoang Chi Cong
Looking for a special chance.......
Chris C. Guevarra
Occasional Contributor

Re: FTP security

Thanks guys