Operating System - HP-UX
1752795 Members
6009 Online
108789 Solutions
New Discussion юеВ

how to restrict ftp user only access it's own home directory

 
SOLVED
Go to solution
Md. Minhaz Khan
Super Advisor

how to restrict ftp user only access it's own home directory

When an HP-UNIX user login as a ftp user, it can access other directory besides it's own home directory.

How can i restrict ftp user only access it's own home directory
7 REPLIES 7
Robert-Jan Goossens_1
Honored Contributor

Re: how to restrict ftp user only access it's own home directory

Hi,

You will need to have a registered support contract to view next document.

Title: How to set up restricted or chroot'd user accounts with FTP
Document ID: emr_na-c00905690-5

http://www11.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00905690-5

Regards,
Robert-Jan

Ps, please assign points for answers to your questions!
http://forums11.itrc.hp.com/service/forums/pageList.do?userId=WW185421&listType=unassigned&forumId=1
Jeeshan
Honored Contributor
Solution

Re: how to restrict ftp user only access it's own home directory

salam minhaz

take a look at the attachement
a warrior never quits
Kapil Jha
Honored Contributor

Re: how to restrict ftp user only access it's own home directory

If that user is not very important , i mean only doing ftp thing....change his/her shell to restricted shell , this would stop him from moving anwhere aprt from his home directory.

google+restricted shell

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Steven Schweda
Honored Contributor

Re: how to restrict ftp user only access it's own home directory

> You will need to have a registered support
> contract [...]

There is some evidence to the contrary [*],
but I claim that "man ftpd" and "man
ftpaccess" contain all you need to know to
set up "guest" users. For these "guest"
users, the ftpd does a chroot(), which should
hide other parts of the file system.

As explained ("man ftpd"), you do need to add
some things to a guest user's home directory
if you want all the usual FTP commands to
work.


[*] http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1303627
Md. Farhan A Azam
Trusted Contributor

Re: how to restrict ftp user only access it's own home directory

Salam Minhaz, it will help you,


1) FTP restricted user creation {modify it as per your requirment}
#useradd -m -d /homedirectory/./ -s /usr/bin/false -g {group} {username}

2) If you alreday have created the user,

#vi /etc/passwd

and add /./ after home directory...user will not be able to move to other directory (but user can login through telnet)

3) If want to block telnet also (user can login through ftp only).

#vi /etc/passwd

/usr/bin/false (chnage the shell)
Md. Farhan A Azam
Trusted Contributor

Re: how to restrict ftp user only access it's own home directory

Hello,

Don't forgot to assign the points..
Md. Minhaz Khan
Super Advisor

Re: how to restrict ftp user only access it's own home directory

Thanks a lot to everybody.