Posts Tagged pure-ftpd

Install pure-ftpd & restrict users to their home directories (Fedora/openSuse)

Hello everyone,

Steps to install pure-ftpd and jail users:

Note-1) On typing ‘ftp localhost’, if you get “Install command ‘ftp’ to provide command ‘ftp’? [N/y]” error message, don’t worry that perfectly normal.  Simply type y. This is “ftp client binary”, whereas vsftpd is “ftp server”.

Step-1) To install pure-ftpd, on the terminal type:
        su -c ‘yum -y install ftp pure-ftpd’

Step-2) To jail users to their home directories, on the terminal type:
        su -c ‘[nano/vi/emacs] /etc/pure-ftpd/pure-ftpd.conf’
        Search for text “ChrootEveryone” and change it’s value to “yes”.

Step-3) To allow local users to login, on the terminal type:
        su -c ‘[nano/vi/emacs] /etc/pure-ftpd/pure-ftpd.conf’
        Search for text “UnixAuthentication” and change it’s value to “yes”

Step-4) Restart service:
        su -c ‘service pure-ftpd restart’

Step-5) If you skip this, you will get “500 OOPS: cannot change directory:/home/user_name” error when you login to ftp server.
        su -c ‘setsebool -P ftp_home_dir on’

    Congratulations! you have successfully jailed users to their respective home directories.

Step-6) To test, on the terminal windows type:
        ftp localhost
        (when prompted, enter local computer login credentials)
        pwd
        ls -lh
        ls -lh ../../.. OR whatever you want to check.

 

I sincerely hope you liked it. Please leave your valuable comments and suggestions.

, , , , ,

2 Comments

Install pure-ftpd & restrict users to their home directories (Ubuntu)

Hello everyone,

Steps to install pure-ftpd and jail users:

Step-1) To install pure-ftpd, on the terminal type:
sudo apt-get -y install pure-ftpd

Step-2) To jail users to their home directories, on the terminal type:
        cd /etc/pure-ftpd/conf
        sudo touch ChrootEveryone (Note: Please type the name as it is. It’s case-sensitive.)
        sudo [nano/vi/emacs] ChrootEveryone
        type ‘yes’ in the file, save and exit.

Step-3) Restart service:
        sudo service pure-ftpd restart

    Congratulations! you have successfully jailed users to their respective home directories.

Step-4) To test, on the terminal windows type:
        ftp localhost
        #(when prompted, enter local computer login credentials)
        pwd
        ls -lh
        ls -lh ../../.. OR whatever you want to check.

 

I sincerely hope you liked it. Please leave your valuable comments and suggestions.

, , , ,

No Comments

Guide to create virtual-user in pure-ftpd

NOTE: It is assumed that you are using root login.

 

‘Fedora / RedHat / OpenSuse’ users:

Step 1) Open terminal window and type:
yum install -y pure-ftpd

 

Ubuntu / Debian users:

Step 1) Open terminal window and type:
apt-get install -y pure-ftpd

 

Step 2) Create new system group.
groupadd [ftpgroup]

Step 3) Create new system user.
useradd -g [ftpgroup] -d /dev/null [ftpuser]

Step 4) Use pure-pw (tool provided by pure-ftpd) to create virtual user.
pure-pw useradd [username] -u [ftpuser] -d [/home/ftpusers/username]

On pressing enter, you will be asked to enter virtual user’s password & then again to confirm the same password.

Step 5) Untill here, changes are not saved by pure-ftpd. To commit changes enter the following command:
pure-pw mkdb

Step 6) To start pure-ftpd as standalone server type:
pure-ftpd -j -lpuredb:/etc/pure-ftpd/pureftpd.pdb &

Step -7) Success… Now, connect to the server using:
ftp localhost [or ipaddress]

enter virtual user credentials [username and password] as supplied in step 4, to login.

, , , , ,

1 Comment