Posted by: isaraffee | February 9, 2010

Configuring FTP in Slackware 12.0

Configuring FTP in Slackware 12.0

To explore ftp you will need a ftp client and ftp server. If you do not have two hosts i.e. one will act as a ftp client and the other the ftp server, you can still experiment with ftp because a host can be configured as a ftp client and ftp server.

In this section I will be configuring my slackware as a ftp client and ftp server.

Configuring the ftp client

Firstly let’s configure it as a ftp client. There is not much to configure. You will need to check that you have the ftp client program. Type :

# which ftp

/bin/ftp

Configuring the ftp server

You will check if the ftp server is installed. Most of the time I use proftp as a ftp server. Let’s check if it is install, One way to check is to type:

# which proftpd

/usr/sbin/proftpd

Another command line that will launch the package manager is to type:

# pkgtool

The other way is to use GUI I.e. the Kpackage. Once in Kpackage search for the program name.

If you have slapt-get installed, you can type:

root@galaxy:~# slapt-get –list | grep proftp

Failed to open package_data

package_data: No such file or directory

Perhaps you want to run –update?

proftpd-1.3.0a-i486-1 [inst=yes]: proftpd (FTP server daemon)

If it is not installed, you will need to download it from the Internet and install it. For example, type:

# installpkg programname.tgz

Now let’s check if the proftpd server service is running.

root@galaxy:~# ps -ef|grep ftp

root 3868 3412 0 06:49 pts/1 00:00:00 grep ftp

It’s not running. To start the proftpd server, tpe:

This is the default proftpd configuration file:

root@galaxy:/etc# more proftpd.conf | grep -v “^#”

ServerName “ProFTPD Default Installation”

ServerType inetd

DefaultServer on

Port 21

Umask 022

MaxInstances 30

User nobody

Group nogroup

SystemLog /var/log/proftpd.log

TransferLog /var/log/xferlog

<Directory /*>

AllowOverwrite on

</Directory>

<Anonymous ~ftp>

RequireValidShell off

User ftp

Group ftp

# We want clients to be able to login with “anonymous” as well as “ftp”

UserAlias anonymous ftp

# Limit the maximum number of anonymous logins

MaxClients 50

# We want ‘welcome.msg’ displayed at login, and ‘.message’ displayed

# in each newly chdired directory.

DisplayLogin welcome.msg

DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot

<Limit WRITE>

DenyAll

</Limit>

# An upload directory that allows storing files but not retrieving

# or creating directories.

</Anonymous>

To run proftpd as a standalone, edit the configuration file by making sure that the value for the ServerType reads Standalone and not inetd.

REstart inetd

root@galaxy:~# more /var/run/inetd.pid

3132

root@galaxy:~# kill -9 3132

root@galaxy:~# ps -ef|grep inetd

root 3996 3427 0 07:20 pts/3 00:00:00 grep inetd

root@galaxy:~# inetd

root@galaxy:~# ps -ef|grep inetd

root 3998 1 0 07:20 ? 00:00:00 inetd

root 4000 3427 0 07:20 pts/3 00:00:00 grep inetd

root@galaxy:~#

root@galaxy:~#

root@galaxy:~# proftpd

– IPv6 getaddrinfo ‘localhost’ error: Name or service not known

Start proftpd and ftp

root@galaxy:/var/log# ftp 127.0.0.1

Connected to 127.0.0.1.

220 ProFTPD 1.3.0a Server (ProFTPD Default Installation) [::ffff:127.0.0.1]

Name (127.0.0.1:root): root

331 Password required for root.

Password:

530 Login incorrect.

Login failed.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp>

Logs

root@galaxy:/var/log# tail -f proftpd.log

Sep 18 07:21:08 galaxy proftpd[4003] localhost: error setting IPV6_V6ONLY: Protocol not available

Sep 18 07:21:08 galaxy proftpd[4003] localhost: ProFTPD 1.3.0a (stable) (built Tue Apr 10 16:31:07 CDT 2007) standalone mode STARTUP

Sep 18 07:21:15 galaxy proftpd[4005] localhost (localhost[::ffff:127.0.0.1]): error setting IPV6_V6ONLY: Protocol not available

Sep 18 07:21:15 galaxy proftpd[4005] localhost (localhost[::ffff:127.0.0.1]): FTP session opened.

Sep 18 07:21:25 galaxy proftpd[4005] localhost (localhost[::ffff:127.0.0.1]): SECURITY VIOLATION: root login attempted.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: