Australia/Sydney
BlogNovember 22, 2010

Restrict FTP User to a Directory in Solaris

Fahd Mirza
I am using Solaris 10 on SPARC.

SunOS ddw 5.10 Generic_139555-08 sun4u sparc SUNW,SPARC-Enterprise

I have put some text files in a directory '/u01/network'

I want to create a ftp user which can just read the files in the network directory. The ftp user shouldn't be able to navigate or see any other directory outside of the network directory.

The user ftp_usr is the owner of /u01/network directory.

Following are settings in /etc/passwd:

ftp_user:x:3008:1::/u01/network:/usr/bin/ftp-only

The settings in the /etc/ftpd/ftpaccess:

allow-retrieve relative class=realusers /u01/network

restricted-uid ftp_user

Also set the permissions on the /u01 directory as 755.

And you are all set to go.
Share this post:
On this page

Let's Partner

If you are looking to build, deploy or scale AI solutions — whether you're just starting or facing production-scale challenges — let's chat.

Subscribe to Fahd's Newsletter

Weekly updates on AI, cloud engineering, and tech innovations