Install and configure a ProFTPD instance in Kali Linux

Source: Internet
Author: User
Tags kali linux

Install and configure a ProFTPD instance in Kali Linux

1. Install ProFTPD

In

Root @ kali :~ # Wget ftp://ftp.proftpd.org/historic/source/proftpd-1.3.0a.tar.gz

Root @ kali :~ # Tar-xf proftpd-1.3.0a.tar.bz2 (or tar zxvf proftpd-1.3.0a.tar.gz)

Root @ kali :~ # Cd proftpd-1.3.0a

Root @ kali :~ #./Configure -- prefix =/var/proftpd -- sysconfdir =/etc // set the installation directory/var/proftpd, configuration file directory/etc

Note: if an error occurs in this step
Configure: error: C ++ preprocessor "/lib/cpp" sanity check
Check See 'config. log' for more details
It indicates that the C ++ compiler package is not installed or the kernel header package is missing.
Solution:

1. Run apt-get install glibc-headers gcc-c ++ on the terminal.
2, apt-get install build-essential
Uname-r
Apt-get install linux-headers-'kernel version'

Root @ kali:/proftpd-1.3.0a # make // compile

Root @ kali:/proftpd-1.3.0a # make install // install

2. Configure ProFTPD

Root @ kali:/proftpd-1.3.0a # groupadd kevin // create the kevin Group

Root @ kali:/proftpd-1.3.0a # useradd kevin-g kevin-d/var/ftp-s/sbin/nologin // Add User kevin

Note: you must add a line "/sbin/nologin" to the/etc/shells file (otherwise, a logon Failure error occurs during ftp logon)

Root @ kali:/proftpd-1.3.0a # passwd kevin // SET Password

Root @ kali:/proftpd-1.3.0a # mkdir/var/ftp // create directory

Root @ kali:/proftpd-1.3.0a # chgrp kevin/var/ftp // change the group to which the ftp directory belongs to kevin

Root @ kali:/proftpd-1.3.0a # chmod-R 755/var/ftp // change ftp directory permission to master all permissions, same group and others for read permission

Root @ kali:/proftpd-1.3.0a # vim/etc/proftpd. conf // modify the configuration file

Root @ kali:/proftpd-1.3.0a #/var/proftpd/sbin/proftpd // start the service. After each configuration file is modified, run the "pkill proftpd" command to kill the proftpd service and restart it.


Use ifconfig to view the IP address, for example, 192.168.121.129.

Root @ kali :~ # Ftp 192.168.121.129

Enter the new user name and password.

Alternatively, enter ftp: // 192.168.121.129 in the browser and log on to the page.




If proftpd has been installed in Linux, how can it not be started and the configuration file needs to be changed? How to change it?

1. Configure the method for running ProFTPD

ServerType inetd

# Set the user and group that the server normally runs.

User nobody

Group nobody

If inetd,/etc/init. d/proftpd start is selected for ServerType, an error is returned because you have selected inetd to run.

ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.

To manually execute ProFTPD, set ServerType to standalone.

2. NIS Authentication

/Etc/nsswitch. conf must have the nis Service

# Users require a valid shell listed in/etc/shells to login.

# Use this directive to release that constrain.

# RequireValidShells off

You must put the shell information/usr/local/bin/bash passed by NIS Sever in the/etc/shells list; otherwise, it is regarded as invalid shell.

In addition, you can directly modify the field of the corresponding shell in the/etc/passwd file to/bin/bash to ignore the shell information sent from the remote end.

There is also an important setting,

# Uncomment this if you are using NIS or LDAP to retrieve passwords:

PersistentPasswd off

If PersistentPasswd is set to on, only check the user account in/etc/passwd. Do not use uncomment. Use the above statement. Remember!

3. xinet start ProFTPD

# Set the user and group that the server normally runs.

User root

Group root

Create/etc/xinetd. d/proftpd and edit the following content.

Service ftp

{

Disable = no

Flags = REUSE

Socket_type = stream

Wait = no

User = root

Server =/usr/sbin/proftpd

Server_args =-c/etc/proftpd. conf

Log_on_success + = DURATION USERID

Log_on_failure + = USERID

}

After saving, chmod + x proftpd

Everything gonna be alright !... Remaining full text>

After proftpd is installed in linux, check the connection input and add the ip address set by the ftp. Then, the connection refused is always displayed. How can this problem be solved?

Proftpd can be started in either xinetd or standalone mode. The method in which proftpd works is specified by/etc/proftpd. conf. During compilation, If you accidentally install all the files in the two working methods, two proftpd options may appear in setup-system services, one of which is specified to be started by xinetd, start in standalone mode.

When xinetd is started,/etc/xinetd is changed. d/proftpd file disable = no, If/etc/proftpd. if standalone is specified in conf, the ftp service cannot be correctly executed. The default setting in/etc/proftpd. conf is standalone.

Conflicts may also occur when started by/etc/rc. d/init. d/proftpd (standalone mode.

Perform the following steps:

(1) check whether the proftpd configuration file is in/usr/local/etc:
Strings in. proftpd | grep proftpd. conf

(2) check whether there is a syntax error in proftpd. conf. check against the document line by line. The default configuration file will not be faulty,

(3) check whether the real user and group executing proftpd exist. This user is specified by the user and group in proftpd. conf. the user and group executing proftpd under redhat should be nobody,

(4) Check whether anonymous ftp users exist,

(5) check whether the ScoreboardFile of proftpd exists (the file location is specified by proftpd. conf. It must exist before running proftpd, and the real user executing proftpd has the read and write permissions)

Check whether the proftpd settings are correct.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.